Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi

I want to get RGB values(5 6 5 format) from each pixel of a bitmap array.
Can someone guide me as how to do this.

Thanks

[added]

I got the solution.

Thanks everyone..!!
[/added]
Posted
Updated 26-May-10 22:51pm
v3

Did you read the documentation [^]?

for instance the following section of BITMAPINFO struct documentation looks promising:

A DIB consists of two distinct parts: a BITMAPINFO structure describing the dimensions and colors of the bitmap, and an array of bytes defining the pixels of the bitmap. The bits in the array are packed together, but each scan line must be padded with zeroes to end on a LONG data-type boundary. If the height of the bitmap is positive, the bitmap is a bottom-up DIB and its origin is the lower-left corner. If the height is negative, the bitmap is a top-down DIB and its origin is the upper left corner.

:)
 
Share this answer
 
Dear,

I wish this could be the answer of your question.

MIDL
System.Drawing.Bitmap b = new Bitmap(Image.FromFile("@C:\abc.jpg"));
b.GetPixel(0, 0).R ;
b.GetPixel(0, 0).G;
b.GetPixel(0, 0).B;


Thanks
 
Share this answer
 
Can you provide more information? There are many things that you could mean when you say "bitmap".
 
Share this answer
 
Using Lockbits improve the performance, the above solution should work
 
Share this answer
 

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