16 Bit Grayscale Images - how to setpixel?

G

Guest

Hi All

Cannot seem to access framework.drawing from home, so I'll ask here..

I need to build up a 16-bit-per-pixel grayscale image 'from scratch'. I have a file containing 16-bit unsigned integer data representing a shade of gray for each pixel. The file has (1) a fixed length, and (2) a known number of rows and columns, with one value per row/column pair (i.e., one value per pixel).

I need to load this file into an image object and then manipulate it. I appears the most straightforward (though least efficient) way to to this is to create an image, set its pixel format to ...16bppgrayscale and then do a setpixel for each value in my file. I could then save it off as a bitmap and not have to repeat this operation in the future. But I can't find a way to set a pixel to anything other than Color.FromArgb, which only takes 0-255 for a given channel's value. This won't give me the color depth I need (0-32767)

Any idea how I might do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top