LEADTOOLS Support
General
LEADTOOLS SDK Examples
How to Save multi-tiffed images with different compression format and/or resolution(DPI)
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, May 31, 2006 11:08:16 AM(UTC)
Groups: Registered
Posts: 1
Hi, I'd like to have an example of saving the multip-tiffed images into different compression format such as TIFF Group 4 and/or different resolution. I tried the properties SaveResolutionCount, SaveResolutionWidth, and SaveResolutionHeight provided by LEAD SDK Help PDF. However, the resolution size still remains the same when I checked the property of saved images.
The following is the subroutine I used to save tiffed-images with different settings.
Private Sub RepairImage(lstrSrcFileName As String, lstrDestFileName As String, lnWidth As Long, lnHeight As Long)
Dim i As Integer
Me.LEAD1.Load lstrSrcFileName, 0, 0, -1 ' load a multi-tiffed image
' This doesn't work
Me.LEAD1.SaveResolutionCount = LEAD1.BitmapListCount
For i = 0 To LEAD1.BitmapListCount - 1
' get the i page from the multi-page TIF file
LEAD1.BitmapListIndex = i
If Me.chkFixSize.Value = 1 Then
Me.LEAD1.Size lnWidth, lnHeight, RESIZE_NORMAL
End If
If Me.chkFixDPI.Value = 1 Then
' Unable to save resolution.
Me.LEAD1.InfoXRes = 600
Me.LEAD1.InfoYRes = 600
' This doesn't work, either.
Me.LEAD1.SaveResolutionWidth(i) = 600
Me.LEAD1.SaveResolutionHeight(i) = 600
End If
If i = 0 Then
Me.LEAD1.Save lstrDestFileName, Me.LEAD1.InfoFormat, LEAD1.InfoBits, QFACTOR_QS, SAVE_OVERWRITE 'compress ans size are equally important
Else
Me.LEAD1.Save lstrDestFileName, Me.LEAD1.InfoFormat, LEAD1.InfoBits, QFACTOR_QS, SAVE_APPEND 'compress ans size are equally important
End If
Next
End Sub
Kevin Wong
#2
Posted
:
Sunday, June 4, 2006 5:07:36 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
About the SaveResolutionCount, SaveResolutionWidth, SaveResolutionHeight properties, currently, only the JBIG format uses these properties. This is why these properties don't work with TIFF file format.
However, you can change the resolution (DPI) of the file that you want save by changing the Lead1.BitmapXRes and Lead1.BitmapYRes properties before saving the TIFF file.
For more information, please refer to the following topics in the LEADTOOLS Main OCX Help File:
- BitmapXRes property (Main Control)
- BitmapYRes property (Main Control)
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Thursday, March 29, 2007 7:55:46 AM(UTC)
Groups: Registered
Posts: 1
That works great, but then how do you keep a standard size? 8.5x11
Thanks,
Todd.
#4
Posted
:
Sunday, April 1, 2007 11:19:43 PM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
You need to set the DPI and/or resize the image to achieve the desired width and height. The condition is that DPI = size in pixels/size in inches.
For example, if DPI is 100 and width in inches is 8.5, the width in pixels should be 850 (100 * 8.5)
And so on.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
LEADTOOLS Support
General
LEADTOOLS SDK Examples
How to Save multi-tiffed images with different compression format and/or resolution(DPI)
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.