//可以无限叠加 你可以试试
//Creater: tech_vina 2011-1-9-15:17 <Wish can help you>
//////////////////////////////////////////////////////////////////////////
CBitmap bmp0;
bmp0.CreateCompatibleBitmap( pDC , rectAll.Width() , rectAll.Height() );
CDC memDC_0;
memDC_0.CreateCompatibleDC( pDC );
memDC_0.SelectObject( &bmp0 );
//My Draw Function
DrawRealViewLine( &memDC_0 , m_rect_1 , m_rect_2 , m_rect_3 );
pDC-> BitBlt( 0 , 0 , rectAll.Width() , rectAll.Height() , &memDC_0 , 0 , 0 , SRCCOPY );
//////////////////////////////////////////////////////////////////////////
CBitmap bmp1;
bmp1.CreateCompatibleBitmap(pDC,rectAll.Width(),rectAll.Height());
CDC memDC_1;
memDC_1.CreateCompatibleDC(pDC);
memDC_1.SelectObject(&bmp1);
//My Draw Function
DrawPointMessage(&memDC_1);
memDC_1.SetBkColor( RGB(0,0,0) );
CBitmap bmp1_mask;
bmp1_mask.CreateBitmap( rectAll.Width() , rectAll.Height() , 1 , 1 , NULL );
CDC memDC_1mask;
memDC_1mask.CreateCompatibleDC( pDC );
memDC_1mask.SelectObject( &bmp1_mask );
memDC_1mask.BitBlt( 0 , 0 , rectAll.Width() , rectAll.Height() , &memDC_1, 0 , 0 , SRCCOPY );
pDC-> BitBlt( 0 , 0 , rectAll.Width() , rectAll.Height() , &memDC_1, 0 , 0 , SRCINVERT );
pDC-> BitBlt( 0 , 0 , rectAll.Width() , rectAll.Height() , &memDC_1mask, 0 , 0 , SRCAND );
pDC-> BitBlt( 0 , 0 , rectAll.Width() , rectAll.Height() , &memDC_1, 0 , 0 , SRCINVERT );
////////////////////////////////////////////////////////////////////////// MFC CBitmap CDC 多图绘制 多图叠加 多图合并
最新推荐文章于 2024-04-01 13:08:52 发布
本文介绍了一种在Windows环境下使用C++进行位图绘制的方法。通过创建兼容位图和设备上下文,实现复杂的图形绘制功能,如绘制实视图线和点消息,并通过位图掩膜实现图像的叠加效果。此技术适用于需要高效图形处理的应用场景。
415

被折叠的 条评论
为什么被折叠?



