位图图像如何转换为单色图像? [英] How is a bitmap image converted into a monochrome image?

查看:537
本文介绍了位图图像如何转换为单色图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将位图图像转换为 binary 单色图像?

How can I convert a bitmap image into a binary monochrome image?

推荐答案

我猜您创建了一个新的1位位图然后为与原始颜色或阴影相对应的每个位置添加黑色或白色像素.
I guess you create a new 1-bit bitmap and then add black or white pixels for every position that corresponds to some colour or shade in the original.


使用CreateBitmap 创建大小相同的位图,颜色为1位, 1位深度.将其选择为DC(例如DestDC).
选择源位图到另一个DC中(例如SourceDC),然后将源DC背景色(通过SetBkColor设置)设置为目标颜色为白色(其余颜色为黑色).
比从源头到目的地.
Use CreateBitmap to create a bitmap of teh same size, 1 bit for color and 1 bit for depth. Select it into a DC (say DestDC).
Select the source bitmap into another DC (say SourceDC), than set the source DC background color (via SetBkColor) to the color you will make white in the destination(the rest will be black).
Than BitBlt the source into the destination.


是的.我有同样的问题...
有人可以为c ++中的源代码提供一些帮助吗??
yeah.. i''ve same problem...
anyone give some help for the source code in c++ please...?


这篇关于位图图像如何转换为单色图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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