专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Brew

Transform旋转之后的背景如何设置透明色

发布时间:2010-05-30 20:16:38 文章来源:www.iduyao.cn 采编人员:星星草
Transform旋转之后的背景怎么设置透明色。
代码如下:
void CGameScreen::PaintTransform(IBitmap * pBitMap, int nAngle, int nX, int nY)
{
AEEBitmapInfo BitmapInfo;
IBITMAP_GetInfo(pBitMap, &BitmapInfo, sizeof(AEEBitmapInfo));
AEETransformMatrix pMatrixTransform;
pMatrixTransform.A = ((256 * GetCos(nAngle)) >> 16);
pMatrixTransform.B = ((256 * GetSin(nAngle)) >> 16);
pMatrixTransform.C = ((-256 * GetSin(nAngle)) >> 16);
pMatrixTransform.D = ((256 * GetCos(nAngle)) >> 16);

IBitmap* dst = NULL;
ITransform* pTransform = NULL;
IBITMAP_CreateCompatibleBitmap(pBitMap,&dst,BitmapInfo.cx,BitmapInfo.cy);
int neeor = IBITMAP_QueryInterface(dst,AEECLSID_TRANSFORM,(void**)&pTransform);
ITRANSFORM_TransformBltComplex(pTransform, nX, nY, pBitMap, 0, 0, BitmapInfo.cx, BitmapInfo.cy, &pMatrixTransform, COMPOSITE_OPAQUE);
IDISPLAY_BitBlt(m_pAppCtx->GetDisplay(),nX, nY, BitmapInfo.cx, BitmapInfo.cy, dst,0,0,AEE_RO_COPY);
IBITMAP_Release(dst);
ITRANSFORM_Release(pTransform);
}


------解决方案--------------------
在IDISPLAY_BitBlt之前,做个透过色处理应该就可行了。
------解决方案--------------------
得到当前的的位图的IBitmap接口,然后有IBitMap_SetTransparentColor做一下颜色过滤就可以了
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: