Loading...

Resize Tiff

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

Resize Tiff

Postby malak » Thu Jun 18, 2009 2:23 pm

Hello,

I am trying to resize, rotate and crop multi-page tiff images. but i couldn't do that.
here is my code:
Code: Select all
 
  if (imaging.TiffIsMultiPage(imageInt))
                {
                    int count = imaging.TiffGetPageCount(imageInt);
                    for (int i = 1; i <= count; i++)
                    {
                        imaging.TiffSelectPage(imageInt, i);
                        imaging.Resize(imageInt, width, height, InterpolationMode.InterpolationModeHighQuality);
// After this line i find : imaging.TiffGetPageCount(imageInt) equal zero, and imaging.TiffIsMultiPage(imageInt) equal false.
                    }
                }
                else
                {
                    imaging.Resize(imageInt, width, height, InterpolationMode.InterpolationModeNearestNeighbor);
                }


i couldnt resize the page when it's multipage. and when i try to save the image after this code. i get unsupported format.
i also want to make sure that: "SaveAsByteArray" method can save multipage tiff.

Thanks in advance.
malak
 
Posts: 4
Joined: Sun Nov 09, 2008 6:04 pm

Re: Resize Tiff

Postby Loïc » Sat Jun 20, 2009 1:50 pm

Hi,

To open the multipage tiff you should use this method: TiffCreateMultiPageFromFile()

Here, you will be able to edit each page (resizing, effect, filters, delete, add...)

And to save the file: TiffSaveMultiPageToFile()

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

Re: Resize Tiff

Postby malak » Sat Jun 20, 2009 6:06 pm

Hello Loic,
Thanks for your response,

Unfortunately I dont use files in my application, instead i use byte array.
so before the previous code i write:
Code: Select all
int imageInt = imaging.CreateGdPictureImageFromByteArray(ref image);
// where image is a byte[] containing a tiff multipage image


it loads fine.. i check if the page is multipage and it says true, i also check for page count and it says 5 for example. so i suppose i dont have problem with loading the tiff.

would you try my code and see if it works?

Thanks in advance
malak
 
Posts: 4
Joined: Sun Nov 09, 2008 6:04 pm

Re: Resize Tiff

Postby Loïc » Sun Jun 21, 2009 11:01 am

Hi,

you can use the CreateGdPictureImageFromByteArray instead the TiffCreateMultiPageFromFile(). The result will be the same.

would you try my code and see if it works?

It works.

Note: You should also call TiffOpenMultiPageAsReadOnly(True)

Kind 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 2 guests

cron