Home All Groups Group Topic Archive Search About

ID'ing color in a bitmap

Author
4 Apr 2006 2:53 PM
pmclinn
I import a bitmap into a .net.  The bitmap is made up of black and
white pixels.  Is there a way to test a single point on the bitmap and
discover if it is in fact black or write?  I basically want to test
areas pixel by pixel.

Author
4 Apr 2006 1:59 PM
Chris
pmclinn wrote:
> I import a bitmap into a .net.  The bitmap is made up of black and
> white pixels.  Is there a way to test a single point on the bitmap and
> discover if it is in fact black or write?  I basically want to test
> areas pixel by pixel.
>

You can use the Bitmap.GetPixel() class which returns a Color object.
You can use this color object to look at the RGB values.  Depending on
the bitmap this may mean that the R, G & B values are either 0 or 255
but more than likely they will be like close to 0 & 255.

hope this helps.
Chris
Author
4 Apr 2006 3:01 PM
Herfried K. Wagner [MVP]
"pmclinn" <pmcl***@gmail.com> schrieb:
>I import a bitmap into a .net.  The bitmap is made up of black and
> white pixels.  Is there a way to test a single point on the bitmap and
> discover if it is in fact black or write?  I basically want to test
> areas pixel by pixel.

'Bitmap.GetPixel'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>