请问一下,我现在如何做才能吧BITMAPINFO得到的数据应用到TransparentBlt显示出来呢?谢谢~

howard 2005-12-20 09:35:19
BITMAPINFO *Bitmap = NULL;
BITMAPFILEHEADER bfh;


BOOL TransparentBlt(
HDC hdcDest, // handle to destination DC
int nXOriginDest, // x-coord of destination upper-left corner
int nYOriginDest, // y-coord of destination upper-left corner
int nWidthDest, // width of destination rectangle
int hHeightDest, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXOriginSrc, // x-coord of source upper-left corner
int nYOriginSrc, // y-coord of source upper-left corner
int nWidthSrc, // width of source rectangle
int nHeightSrc, // height of source rectangle
UINT crTransparent // color to make transparent
);
...全文
102 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
在blt前面
BITMAPINFO *Bitmap;
Bitmap=NULL;
BITMAPINFOHEADER* pbfh;
unsigned long Length;
m_VFWImageProc.CaptureDIB(&Bitmap,0,&Length);
pbfh=&(Bitmap->bmiHeader);
this->bmpData=(char *)Bitmap;
this->bmpData+=m_VFWImageProc.CalcBitmapInfoSize(*pbfh);


int ret = 0;
// Paint the image to the device.
ret = SetDIBitsToDevice (
dcSrc->m_hDC /*hdc*/,
0/*x*/,0/*y*/,m_FrameX/*Width*/,
m_FrameY/*Height*/,0,0,
0,m_FrameY/*Height*/,
(LPVOID)(bmpData),
Bitmap/*pbmi*/,0);
delete Bitmap;
howard 2005-12-20
  • 打赏
  • 举报
回复
呵呵,好久没见啦,最近混的很好吧。羡慕啊。。机战你还去玩么?我都很久没去了
howard 2005-12-20
  • 打赏
  • 举报
回复
我目前用DC是可以画出来的。不过原始窗口也在界面上显示出来了,如果把原始的窗口移动到屏幕外面,就画不出来了,不过原始窗口移动到屏幕外面也可以得到BITMAPINFO。所以我想的是把原始的窗口移动到屏幕外面,程序界面只显示一个TransparentBlt 后的屏幕
蒋晟 2005-12-20
  • 打赏
  • 举报
回复
你要先把图像选择到DC里面去再blt

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧