Click here to Skip to main content
13,293,178 members (38,387 online)
Rate this:
Please Sign up or sign in to vote.
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 19-Jul-12 23:32pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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 )
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171207.1 | Last Updated 20 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100