Device-Dependent Bitmaps (DDB) 设备相关位图

设备相关的位图(DDB)使用单一结构BITMAP结构描述。该结构的成员指定矩形区域的宽度和高度,以像素为单位;将条目从设备调色板映射到像素的数组的宽度;以及器件的颜色格式,在每个像素的颜色平面和位数方面。应用程序可以通过调用GetDeviceCaps函数并指定适当的常量来检索设备的颜色格式。请注意,DDB不包含颜色值;相反,颜色是依赖于设备的格式。有关详细信息,请参阅位图中的颜色。因为每个设备都可以有自己的颜色集,所以为一个设备创建的DDB可能在不同的设备上可能不会很好地显示。
要在设备上下文中使用DDB,它必须具有该设备上下文的颜色组织。因此,DDB通常被称为兼容位图,并且通常具有比DIB更好的GDI性能。例如,要创建视频内存的位图,最好使用与主显示屏相同颜色格式的兼容位图。一旦在视频存储器中,渲染到位图并将其显示到屏幕上显着快于从系统存储器表面或直接从DIB。
除了能够实现更好的GDI性能之外,还可以使用兼容的位图来捕获图像(请参阅捕获图像),并在运行时为菜单创建位图,请参见“创建位图”(请参阅​​使用菜单)。

要在具有不同颜色组织的设备之间传输位图,请使用GetDIBits将兼容位图转换为DIB,并调用SetDIBits或StretchDIBits以将DIB显示到第二个设备。

DDB有两种类型:可丢弃和不可忽略。一个可丢弃的DDB是一个位图,系统丢弃位图没有被选中到DC,如果系统内存不足。CreateDiscardableBitmap函数创建可丢弃的位图。CreateBitmap,CreateCompatibleBitmap和CreateBitmapIndirect函数创建不可忽略的位图。

应用程序可以通过初始化所需的结构并调用CreateDIBitmap函数从DIB创建DDB。在调用CreateDIBitmap时指定CBM_INIT等效于调用CreateCompatibleBitmap函数以设备格式创建DDB,然后调用SetDIBits函数将DIB位转换为DDB。要确定设备是否支持SetDIBits函数,请调用GetDeviceCaps函数,将RC_DI_BITMAP指定为RASTERCAPS标志。原文:https://msdn.microsoft.com/en-us/library/dd183561(v=vs.85).aspx

相关阅读:

device-independent bitmap (DIB) 设备无关位图

BMP图像数据格式详解


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Dependency Walker 可以自由查看任何32位 或 64位 Windows 程序模块的内部层次依赖关系与结构关系 (包括exe, dll, ocx, sys, 等文件),并通过树状图示的方式显示。 本资源为32位系统支持,其他位宽程序请查看下面官网下载 http://www.dependencywalker.com/ (以下不做翻译) For each module found, it lists all the functions that are exported by that module, and which of those functions are actually being called by other modules. Another view displays the minimum set of required files, along with detailed information about each file including a full path to the file, base address, version numbers, machine type, debug information, and more. Dependency Walker is also very useful for troubleshooting system errors related to loading and executing modules. Dependency Walker detects many common application problems such as missing modules, invalid modules, import/export mismatches, circular dependency errors, mismatched machine types of modules, and module initialization failures. Dependency Walker runs on Windows 95, 98, Me, NT, 2000, XP, 2003, Vista, 7, and 8. It can process any 32-bit or 64-bit Windows module, including ones designed for Windows CE. It can be run as graphical application or as a console application. Dependency Walker handles all types of module dependencies, including implicit, explicit (dynamic / runtime), forwarded, delay-loaded, and injected. A detailed help is included. Dependency Walker is completely free to use. However, you may not profit from the distribution of it, nor may you bundle it with another product.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值