Loading...

Problem with compression

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Problem with compression

Postby kparker » Fri Jun 26, 2009 8:48 pm

Loic,

I'm having a problem with converting LZW TIFF images into CCITT 4 .

Here is the code I'm using:

Code: Select all
string imgPath = @"C:\Multipage.TIF";
axGdViewer1.DisplayFromFile(imgPath);
for (int i = 0; i < axGdViewer1.PageCount; i++)
            {   axImaging1.SetNativeImage(axImaging1.CreateClonedImage(axGdViewer1.GetNativeImage()));
               
                axImaging1.SaveAsTIFF("c:\\Single_page_" + (i+1) + ".tif", TifCompression.CompressionCCITT4);
                axGdViewer1.DisplayNextFrame();
            }

The problem is that the saved TIFFs (Single_page_1.tif, ...) are all still have LZW compression.

Am I missing something?

Thanks,
kparker
 
Posts: 5
Joined: Fri Feb 08, 2008 8:38 pm

Re: Problem with compression

Postby Loïc » Mon Jun 29, 2009 10:03 am

Hi,

You are probably trying to compress in ccitt4 image which are not bitonal (black & white).

Just add:

Code: Select all
axImaging1.ConvertTo1bpp();


After:

Code: Select all
   {   axImaging1.SetNativeImage(axImaging1.CreateClonedImage(axGdViewer1.GetNativeImage()));


With best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest