The Study of Programming Windows with MFC--Bitmap2

本文详细介绍了Windows API中的::LoadImage函数。此函数不仅能够加载位图资源并创建DDB和DIB节,还支持从BMP文件加载位图,并具备颜色映射功能,能自动将特定灰度值转换为系统颜色。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

::LoadImage is to DIB sections what ::LoadBitmap and CDC::LoadBitmap are to DDBs. But it's also much more. I won't rehash all the input values it accepts because you can get that from the documentation, but here's a short summary of some of the things you can do with ::LoadImage:

  •  

  • Load bitmap resources, and create DDBs and DIB sections from them.

     

     

  • Load bitmaps stored in BMP files, and create DDBs and DIB sections from them.

     

     

  • Automatically convert three shades of gray (RGB (128, 128, 128), RGB (192, 192, 192), and RGB (223, 223, 223)) to the system colors COLOR_3DSHADOW, COLOR_3DFACE, and COLOR_3DLIGHT as an image is loaded.

     

     

  • Automatically convert the color of the pixel in the upper left corner of the bitmap to the system color COLOR_WINDOW or COLOR_3DFACE so that the pixel and others like it will be invisible against a COLOR_WINDOW or COLOR_3DFACE background.

     

     

  • Convert a color image to monochrome.

     

Keep in mind that ::LoadImage's color-mapping capabilities work only with images that contain 256 or fewer colors. DIBs with 256 or fewer colors contain built-in color tables that make color mapping fast and efficient. Rather than examine every pixel in the image to perform a color conversion, ::LoadImage simply modifies the color table.

More on the ::LoadImage Function

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值