关于VC++中导入.BMP图像的问题
本人小菜,在自学图象处理,但是就是不知道怎么把BMP图象导入VC++6.0中进行处理.如有老高,请不吝赐教。关于类啊,源代码还有讲解啊,越详细越好...
本人小菜,在自学图象处理,但是就是不知道怎么把BMP图象导入VC++6.0中进行处理.
如有老高,请不吝赐教。
关于类啊,源代码还有讲解啊,越详细越好 展开
如有老高,请不吝赐教。
关于类啊,源代码还有讲解啊,越详细越好 展开
展开全部
用BitBlt函数导入即可,如下一段代码:
mdc = new CDC;
bitmap = new CBitmap;
backbmp = new CBitmap;
mdc->CreateCompatibleDC(&dc);
backbmp->m_hObject = (HBITMAP)::LoadImage(NULL,
"adv.bmp",IMAGE_BITMAP,1024,800,
LR_LOADFROMFILE);
bitmap->m_hObject = (HBITMAP)::LoadImage(NULL,
"star.bmp",IMAGE_BITMAP,800,500,
LR_LOADFROMFILE);
mdc->SelectObject(backbmp);
dc.BitBlt(0,0,1024,800,mdc,0,0,SRCCOPY);
mdc->SelectObject(bitmap);
dc.BitBlt(250,150,500,300,mdc,300,0,SRCAND);
导入了两张位图.
mdc = new CDC;
bitmap = new CBitmap;
backbmp = new CBitmap;
mdc->CreateCompatibleDC(&dc);
backbmp->m_hObject = (HBITMAP)::LoadImage(NULL,
"adv.bmp",IMAGE_BITMAP,1024,800,
LR_LOADFROMFILE);
bitmap->m_hObject = (HBITMAP)::LoadImage(NULL,
"star.bmp",IMAGE_BITMAP,800,500,
LR_LOADFROMFILE);
mdc->SelectObject(backbmp);
dc.BitBlt(0,0,1024,800,mdc,0,0,SRCCOPY);
mdc->SelectObject(bitmap);
dc.BitBlt(250,150,500,300,mdc,300,0,SRCAND);
导入了两张位图.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询