本文介绍了GDI-如何创建和填充位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以简短地说明如何使用GDI/GDI +创建位图运行时并用颜色填充它吗?
Someone can give me short explanation how to create bitmap runtime using GDI/GDI+ and to fill it with color ?
谢谢.
推荐答案
-
CreateBitmap
,CreateCompatibleBitmap
或CreateDIBSection
(如果要访问原始基础数据位) -
CreateCompatibleDC
-
SelectObject
位图进入已创建的设备上下文 -
FillRect
或设备上下文上的朋友,并且绘制在所选位图上进行(那里有选项:黑色和白色的标准画笔,手上有RGB而不是创建画笔,您可以执行SetBkColor
+ExtTextOut
带空字符串和ETO_OPAQUE
,矩形将被填充) -
SelectObject
返回 - 保留位图以保留绘画
- 释放资源
CreateBitmap
,CreateCompatibleBitmap
orCreateDIBSection
(in case you want access to raw underlying data bits)CreateCompatibleDC
SelectObject
the bitmap into created device contextFillRect
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 doSetBkColor
+ExtTextOut
with an empty string andETO_OPAQUE
and the rectangle will be filled)SelectObject
back- The bitmap remains to hold the painting
- Release the resources
它仍然与标题中的整个屏幕"有关,您需要在其中解释您想要的内容.
Still it has something to do with "entire screen" in the title, and you need explain what you want there.
这篇关于GDI-如何创建和填充位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!