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 : Wednesday, May 9, 2007 7:59:36 AM(UTC)
amarwadi

Groups: Registered
Posts: 2


Hello,
I am trying to use the Jpeg2000SaveOptions in order to compress and save the Raster Image using the following method:

private byte[] Compress(byte[] imageData, int qualityFactor)
        {
            RasterImage image = LoadRasterImage(imageData);
            m_Codecs.Options.Jpeg2000.Save.CompressionControl = CodecsJpeg2000CompressionControl.QualityFactor;
            m_Codecs.Options.Jpeg2000.Save.CompressionRatio = qualityFactor;
           MemoryStream stream = new MemoryStream();
            m_Codecs.Save(image, stream, RasterImageFormat.J2k, 0);

            return stream.ToArray();
        }


No matter what qualityFactor I use, the image compression doesn't seem to be working. Am I doing something wrong out here? Any help would be highly appreciated.

Thank You
Anup
 

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 : Thursday, May 10, 2007 1:37:53 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)




Anup,


You should not pass the QualityFactor value to the "CodecsJpegSaveOptions.CompressionRatio"
property, you should pass it to the "CodecsJpegSaveOptions.QualityFactor" property instead.

 
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.053 seconds.