[英]GDI - How to create and fill bitmap?
Someone can give me short explanation how to create bitmap runtime using GDI/GDI+ and to fill it with color ? 有人可以给我简短的解释,如何使用GDI / GDI +创建位图运行时并用颜色填充它?
Thanks in advance. 提前致谢。
CreateBitmap
, CreateCompatibleBitmap
or CreateDIBSection
(in case you want access to raw underlying data bits) CreateBitmap
, CreateCompatibleBitmap
或CreateDIBSection
(如果要访问原始基础数据位) CreateCompatibleDC
SelectObject
the bitmap into created device context SelectObject
放入创建的设备上下文中 FillRect
or friends on the device context, and the painting takes place on your selected bitmap (there are options there: standard brushes for black and white, having RGB on hands instead of creating a brush you can do SetBkColor
+ ExtTextOut
with an empty string and ETO_OPAQUE
and the rectangle will be filled) FillRect
或设备上下文上的朋友,绘制将在您选择的位图上进行(有选项:黑色和白色的标准画笔,手上有RGB而不是创建画笔,您可以使用空字符串执行SetBkColor
+ ExtTextOut
和ETO_OPAQUE
和矩形将被填充) SelectObject
back SelectObject
返回 Still it has something to do with "entire screen" in the title, and you need explain what you want there. 仍然与标题中的“整个屏幕”有关,您需要在其中解释您想要的内容。
Create your drawable (or just manipulate the graphics object in your paint handler) 创建您的可绘制对象(或仅在绘制处理程序中操作图形对象)
:) :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.