Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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?
Posted

1 solution

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 )
 
Share this answer
 
Comments
Terkosh 24-Jul-12 9:02am    
Thank you for your reply.
Very interesting articles. But I am lazy and found an easy way which works for me: I use for the Fillrectangle a PathGradientBrush with a ColorBlend and for the CenterColor I use the same color but with a fixed low alpha value. This works because the text information is in the center of colorized rectangle.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900