Getting the RGB data as an array out of Bitmap 
Author Message
 Getting the RGB data as an array out of Bitmap

I'd like to do some bitmap manipulation and want to get a pointer of the
start byte of the bitmap RGB data.  However, the Bitmap
(System.Drawing.Bitmap) object only allows
me to get the RGB values at a particular coordinate instead of giving me the
whole array of bitmap data.

Is there any way to work around it?  One way I can think of is to get the
first pixel's RGB data and then get the address of the B data byte, which
should be the ever first byte of the RGB data, if the RGB data are stored in
the same way as a bitmap file.

Please help.  Thanks very much.

Yawen



Mon, 28 Mar 2005 17:09:54 GMT  
 Getting the RGB data as an array out of Bitmap
You can use Bitmap::LockBits to get a pointer to the bitmap data.

Jonathan Schafer

On Thu, 10 Oct 2002 17:09:54 +0800, "Yawen Chan"

Quote:

>I'd like to do some bitmap manipulation and want to get a pointer of the
>start byte of the bitmap RGB data.  However, the Bitmap
>(System.Drawing.Bitmap) object only allows
>me to get the RGB values at a particular coordinate instead of giving me the
>whole array of bitmap data.

>Is there any way to work around it?  One way I can think of is to get the
>first pixel's RGB data and then get the address of the B data byte, which
>should be the ever first byte of the RGB data, if the RGB data are stored in
>the same way as a bitmap file.

>Please help.  Thanks very much.

>Yawen



Mon, 28 Mar 2005 23:25:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Creating a bitmap from an array of color data

2. Declaring an array of pointers in Visual Basic (and putting and getting data from it)

3. Set bitmap in RGB ???

4. RGB in bitmap

5. RGB value of 24bit bitmap

6. Set Bitmap in RGB ???

7. CBitmap: Want to display RGB bitmap, but can only adress G and B

8. Get RGB from particular pixel in bitmap

9. RGB Bitmap

10. Set bitmap in RGB ???

11. How can i create a device independent bitmap from a rgb buffe

12. How can i create a device independent bitmap from a rgb buffer

 

 
Powered by phpBB® Forum Software