TransparentBlt实现
来源:互联网 发布:科比高中数据 编辑:程序博客网 时间:2024/06/05 08:16
参考:http://www.vckbase.com/document/viewdoc/?id=532
http://www.mvps.org/user32/gditutorial.html
以及MSDN2008中StrechBlt、SetBkColor和SetTextColor的Remarks部分。
Updated@2010.12.25: Feng Yuan的GDI编程书的第10章Using DDBs的DDB Color Conversion
小节有详细的介绍。。
这里我贴一下自己觉得从上面资料中找出的最重要的一些原理:
For a monochrome bitmap, the black area is really 0 bits and the white area is really 1 bits.
If StretchBlt must convert a monochrome bitmap to a color bitmap, it sets white
bits (1) to the background color and black bits (0) to the foreground color. To
convert a color bitmap to a monochrome bitmap, it sets pixels that match the
background color to white (1) and sets all other pixels to black (0). The
foreground and background colors of the device context with color are used.
Raster operations (SRCPAINT, SRCCOPY, etc) are performed only after any mapping
has taken place. They are performed bytewise on the image bytes. this is the most
efficient means of operation, but it means that logical raster operations performed
on 256 color displays will tend to have unexpected results, as any palettes are
totally ignored by this process. The default twenty system colors will behave in an
expected way, as the system palette has been arranged specially so the mappings
work. Instead of simply using the 1st twenty colors, the system palette uses the
first ten, and last ten colors, so when a NOT is performed on black (color index 0)
the result of the NOT operation (color index 255) is the expected white.
啥不说了,贴代码(里面有详细的注释):
附图一张(可以测试下,不让上传BMP图,转成gif了):
可以用上面的理论改写《Windows程序设计》第五版14章的BitMask例子,可以不用Rop 0x220326。。。
- TransparentBlt实现
- transparentblt
- TransparentBlt
- TransparentBlt
- TransparentBlt()函数实现图片背景透明
- TransparentBlt用法
- TransparentBlt用法
- 透明贴图TransparentBlt函数
- TransparentBlt的使用
- TransparentBlt 与AlphaBlend
- BitBlt StretchBlt TransparentBlt
- TransparentBlt函数使用注意事项
- 关于TransparentBlt 透明显示问题
- 关于TransparentBlt 透明显示问题
- 关于TransparentBlt 透明显示问题
- 关于TransparentBlt 透明显示问题
- 关于TransparentBlt 透明显示问题
- TransparentBlt 透明位图的显示
- 年终总结2010
- 12月19日php连接mysq的问题
- JAVA初学
- 五大Linux简单命令解决系统性能问题
- vim 在多个文件中替换
- TransparentBlt实现
- 十五个常用Linux命令行总汇
- shell编程日记---01
- [入门]Ruby on Rails入门教程及开发工具选用
- DirectX
- Android使背景灯(Brightness)高亮的方法
- const ,mutable,volatile()
- 3D游戏引擎的基本架构
- linux杂项