Framework .NET 2.0 and 16bpp grayscale

E

eric

Hello,

I'm using the framework .NET 2.0 and need a specific functionality
which does not seem to be present. I would like to save an image using
the following format (16 bit per pixel and grayscale) but it seems
that the framework does not allow this (I tried with GDI+)...Am I
right ? Is it possible to use an external library to do it ?

I will just add that altering the quality of the image to a 8 bit per
pixel image will not be a valid option.

Thanks.
 
E

eric

You can always use an external library to do something.  :)

As far as .NET's support of pixel formats, unfortunately it's true: it's
surprisingly limited as to the variety of pixel formats it supports,
especially when it comes to creating new instances.

I seem to recall being able to read a bitmap format that it won't create
from scratch, so one option might be to read a bitmap of the appropriate
format and then write into it to make a new one.  But that only works if
you can anticipate the pixel dimensions, and those dimensions are always
the same or at least are only among a small set of possibilities.

And it assumes that you can write the formats you can't create from
scratch, which I'm not sure is actually possible, even if there are some
that can be read.

It's possible that you could use the WPF libraries.  I haven't used them
much myself, but I think they are based on DirectX rather than GDI+, and
so there would at least be differences in what's supported (and I think
more pixel formats would be supported).  You can find those classes in
the System.Windows.Media namespace.

Pete

Thanks for your answer Pete.

I checked WPF librairies, unfortunately there are not available for
the version of the framework I'm using...

Does anyone know an external library easy to use which will allow me
to create a 16bpp grayscale image from scratch ?
 

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