This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, November 4, 2008 6:45:13 AM(UTC)
Groups: Registered
Posts: 22
Hello,
I'm using the version V15 of Leadtools (I program in C#) and I have a problem saving images with color (not black & white). The code I use to load & save the image is this:
//Load
RasterCodecs.Startup();
RasterCodecs codecs = new RasterCodecs();
RasterImage img = codecs.Load(sNombreImagen);
//Save
RasterCodecs.Startup();
RasterCodecs codecs = new RasterCodecs();
codecs.Save(_viewerImg.Image, rutaDestinoJPG, RasterImageFormat.Jpeg, 8, 1, 1, 1, CodecsSavePageMode.Overwrite);
RasterCodecs.Shutdown();
I think is normal that I get an black & white image because y use 8 bits per pixel, but if I try to use a greater value (16,24, 32...) I get this error "Invalid bits/pixel" or "Extended grayscale support is required". What am I doing wrong?
#2
Posted
:
Tuesday, November 4, 2008 8:51:27 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
What is the file version of Leadtools.dll that you are using?
Does this happen with all source images or only some?
Are you always saving as RasterImageFormat.Jpeg or are you sometimes using something else?
Extended Grayscale is usually only for 12/16 bpp support. Are you sure this error is getting thrown for 24 and 32? If only 12/16 bpp grayscale, then this is to be expected and you need to unlock support for Document. If you do not have the unlock code for document, you will need to contact
sales@leadtools.com.
#3
Posted
:
Tuesday, November 4, 2008 9:54:03 PM(UTC)
Groups: Registered
Posts: 22
I don't know why now it's working with 24bpp (I'm sure that I tried yesterday). When I try the 16bpp I get "the grayscale error", the other error is which I get if I use 32bpp.
Answering your questions, I use the version 15.0.0.0 of Leadtools.dll and I always save as RasterImageFormat.Jpeg. I did my test with 2 images (both with the same result).
#4
Posted
:
Wednesday, November 5, 2008 3:48:03 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
As for 16bpp, you need to unlock support for document. If you do not have that key, please contact our sales department.
I'm assuming you get something like Invalid Parameter Passed or Feature Not Supported when you try to save the JPEG with 32bpp because JPEGs don't support 32bpp.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.