Loading...

resize image

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

resize image

Postby rhahn » Fri Feb 18, 2011 1:43 am

Hello
I'm trying to append a blank page to a tiff. I have a function that creates a Letter size (8.5x11) 100x100 dpi bmp. I need the new page to be Letter 300x300 and so I do the following.
Code: Select all
       '(GDEdit is Imaging)
        GDResult = GDEdit.CreateImageFromFile(BlankBMP)
        If GDResult = 0 Then
            Err.Raise 334, "frmViewer.AppendBlankPage()", "Error Creating Blank Tiff"
        End If
        GDResult = 0
        GDResult = GDEdit.SetHorizontalResolution(300)
        GDResult = GDResult + GDEdit.SetVerticalResolution(300)
        GDResult = GDResult + GDEdit.ResizeImage(2550, 3300)
        GDResult = GDResult + GDEdit.SaveAsTIFF(BlankTiff, CompressionCCITT4)
        If GDResult <> 0 Then
            Err.Raise 334, "frmViewer.AppendBlankPage()", "Error Resizing Blank Page to Letter"
        End If
        GDResult = GDEdit.TiffMerge2Files(ThisAnnoFile.TempFullPath, BlankBMP, TempFile, CompressionCCITT4)


The Problem is I get a resolution of 900x900 and the size is way off. So i tried GDEdit.ResizeImage(850,1100) that didn't work either. So I tried Just GDEdit.ResizeImage(2550, 3300) without setting the resolution and it is much closer, 8.59x11.11 at 297x297.

Can some one shed some light on how this all works and perhaps a better way. I will be doing a lot of resizing, appending and Inserting of different pages.

Also can someone suggest a way to accomplish inserting and appending blank pages to PDF using GDPicture.

Thank you
Ron
rhahn
 
Posts: 4
Joined: Fri Feb 18, 2011 1:27 am
Location: Edmonton Alberta Canada

Re: resize image

Postby rhahn » Sat Feb 19, 2011 1:27 am

Ok, so I've figured out how to get it closer but I still can't figure out why it is working the way it is working.
Code: Select all
        GDResult = GDResult + GDEdit.ResizeImage(2550, 3300)
        GDResult = GDEdit.SetHorizontalResolution(300)
        GDResult = GDResult + GDEdit.SetVerticalResolution(300)
        GDResult = GDResult + GDEdit.SaveAsTIFF(BlankTiff, CompressionCCITT4)


Doing it in this order makes BlankTiff 300x300 Letter just as I want. I don't understand why the order makes a difference here. If anyone can shed some light on why I would very much appreciate it.

I also still have a question about TiffMerge2Files. When I have two 300x300 Letter single page Tiffs and run them through TiffMerge2Files the resulting tiff has both pages as 299x299 w8.56 h11.07. Why is the resolution changing? Is there anything I can do about. honestly it is close enough but I would like to understand what is happening.

Thank you,
Ron
rhahn
 
Posts: 4
Joined: Fri Feb 18, 2011 1:27 am
Location: Edmonton Alberta Canada

Re: resize image

Postby Loïc » Sat Feb 19, 2011 3:44 pm

Hi Ron,

The ResizeImage function changes the image resolution info according to the new aspect ratio.

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