GDI-如何创建和填充位图? [英] GDI - How to create and fill bitmap?

查看:196
本文介绍了GDI-如何创建和填充位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以简短地说明如何使用GDI/GDI +创建位图运行时并用颜色填充它吗?

Someone can give me short explanation how to create bitmap runtime using GDI/GDI+ and to fill it with color ?

谢谢.

推荐答案

  1. CreateBitmapCreateCompatibleBitmapCreateDIBSection(如果要访问原始基础数据位)
  2. CreateCompatibleDC
  3. SelectObject位图进入已创建的设备上下文
  4. FillRect或设备上下文上的朋友,并且绘制在所选位图上进行(那里有选项:黑色和白色的标准画笔,手上有RGB而不是创建画笔,您可以执行SetBkColor + ExtTextOut带空字符串和ETO_OPAQUE,矩形将被填充)
  5. SelectObject返回
  6. 保留位图以保留绘画
  7. 释放资源
  1. CreateBitmap, CreateCompatibleBitmap or CreateDIBSection (in case you want access to raw underlying data bits)
  2. CreateCompatibleDC
  3. SelectObject the bitmap into created device context
  4. 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)
  5. SelectObject back
  6. The bitmap remains to hold the painting
  7. Release the resources

它仍然与标题中的整个屏幕"有关,您需要在其中解释您想要的内容.

Still it has something to do with "entire screen" in the title, and you need explain what you want there.

这篇关于GDI-如何创建和填充位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆