图象的基本问题

langzi8818 2007-05-14 11:51:30
在一个客户区域内,显示一张图,我画一个椭圆或者一个多边形,怎么把这个区域以外的填充为黑色????
谢谢各位大虾
...全文
238 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
setsailgo 2007-05-15
  • 打赏
  • 举报
回复
源代码见http://blog.csdn.net/jmshl/
setsailgo 2007-05-15
  • 打赏
  • 举报
回复
你说的是遮罩吧,
BOOL BitBlt( int x, int y, int nWidth, int nHeight, CDC* pSrcDC, int xSrc, int ySrc, DWORD dwRop );

dwRop

Specifies the raster operation to be performed. Raster-operation codes define how the GDI combines colors in output operations that involve a current brush, a possible source bitmap, and a destination bitmap. The following lists raster-operation codes for dwRop and their descriptions:

BLACKNESS Turns all output black.


DSTINVERT Inverts the destination bitmap.


MERGECOPY Combines the pattern and the source bitmap using the Boolean AND operator.


MERGEPAINT Combines the inverted source bitmap with the destination bitmap using the Boolean OR operator.


NOTSRCCOPY Copies the inverted source bitmap to the destination.


NOTSRCERASE Inverts the result of combining the destination and source bitmaps using the Boolean OR operator.


PATCOPY Copies the pattern to the destination bitmap.


PATINVERT Combines the destination bitmap with the pattern using the Boolean XOR operator.


PATPAINT Combines the inverted source bitmap with the pattern using the Boolean OR operator. Combines the result of this operation with the destination bitmap using the Boolean OR operator.


SRCAND Combines pixels of the destination and source bitmaps using the Boolean AND operator.


SRCCOPY Copies the source bitmap to the destination bitmap.


SRCERASE Inverts the desination bitmap and combines the result with the source bitmap using the Boolean AND operator.


SRCINVERT Combines pixels of the destination and source bitmaps using the Boolean XOR operator.


SRCPAINT Combines pixels of the destination and source bitmaps using the Boolean OR operator.


WHITENESS Turns all output white.
livedeal 2007-05-15
  • 打赏
  • 举报
回复
先在pDC里显示图片,再加下面的```就可以了`
pDC->BeginPath();
pDC->Ellipse(0,0,650,300);
pDC->EndPath();
pDC->SelectClipPath(RGN_XOR);
pDC->SelectStockObject(BLACK_BRUSH);
CRect rect;
GetClientRect(&rect);
pDC->Rectangle(&rect);
langzi8818 2007-05-15
  • 打赏
  • 举报
回复
兄弟你搞错了.不是你说得透明的.
是遮蔽掉我圈出来的区域以外的区域.我圈的可能是圆,椭圆,或者多边形的封闭
langzi8818 2007-05-15
  • 打赏
  • 举报
回复
兄弟,100分要是你的了估计
langzi8818 2007-05-15
  • 打赏
  • 举报
回复
谢谢livedeal...
Rock_And_Roll 2007-05-15
  • 打赏
  • 举报
回复
windows 图画板

19,468

社区成员

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

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