Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, November 4, 2008 6:45:13 AM(UTC)

RaYWoLF  
RaYWoLF

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?
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, November 4, 2008 8:51:27 AM(UTC)

GregR  
GregR

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)

RaYWoLF  
RaYWoLF

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)

GregR  
GregR

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.073 seconds.