Jump to content
  • Advertisement
Sign in to follow this  
adprice

Displaying 16 bit raw images

This topic is 3334 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If I have an array of data (16 bit values) that represent pixel intensity (in other words a grayscale image), can anyone tell me how to display this data in a picture box in an MFC application? If the code is long or complicated I guess don't worry about it, but it seems like a simple thing that I've just spent way too much time digging around trying to solve. Thanks, Andrew

Share this post


Link to post
Share on other sites
Advertisement
I'm not much in the MFC, but AFAIK you have a Paint event for the picture box.
In it, you can do a blit to the HWND with the data, but I guess you'll need some data transforming before.

I would create a bitmap in memory. I'm not sure if there's an standard 16 bits greyscale bmp, but you can always do:


unsigned char R,G,B;
for (i = 0; i < ArraySize; i++)
{
int Luminance = Array * 256 / 65535;
R = G = B = Luminance;
...
}


And fill up a BitmapInfo structure with these values.
http://msdn.microsoft.com/en-us/library/aa921550.aspx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!