OnPaint事件:使用高Alpha值对位图上的区域着色 [英] OnPaint event: Colorize zones on a bitmap with high alpha value

查看:142
本文介绍了OnPaint事件:使用高Alpha值对位图上的区域着色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个旧软件项目的新手.其中一部分是显示灰度位图(扫描的文档).我有一个我自己不太了解的ImageControl,但是我有一个OnPaint事件,并且使用了graphics.FillRectangle(SolidBrush)为位图的某些区域着色.
问题是这仅适用于具有低alpha值的颜色.使用完整的Alpha值,深色(黑色)文本信息也会被着色并隐藏.

我的问题是:是否有亮度相关的填充选项?

I am new on an old software project. A part of this is to display a grey scaled bitmap (scanned documents). I have an own ImageControl I do not really understand yet but I have a OnPaint event and I use the graphics.FillRectangle(SolidBrush) to colorize some zones of the Bitmap.
The problem is this works only for colors with low alpha values. With a full alpha value, the dark (black) text information is colorized too and hidden then.

My question is: is there a brightness dependent fill option? That bright pixels are more affected than dark pixels?

推荐答案

没有,您需要写一个.您可以阅读我的图像处理文章,以获取有关检测较亮像素的想法,或编写滤镜以针对像素的值修改像素(每个像素的滤镜)
No there isn''t, you''d need to write one. You can read my image processing articles for ideas on detecting brighter pixels or writing a filter that modifies pixels with respect to their values ( per pixel filters )


这篇关于OnPaint事件:使用高Alpha值对位图上的区域着色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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