Thumbnails

Discussions about image processing and document imaging.
Post Reply
jaquesb
Posts: 1
Joined: Thu Aug 30, 2007 2:13 pm

Thumbnails

Post by jaquesb » Thu Aug 30, 2007 3:03 pm

Can your component show multipage Tif files as thumbnails?

Thanks
Jaques

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Mon Sep 03, 2007 11:38 am

Hi,

You can do that with the GdPicture Pro component:

https://gdpicture.com/references/gdpictu ... bnail.html

ex:

Code: Select all

Dim ogdpicture as new gdpicturepro.cgdpicture
Dim nThumbnailID as long

ogdpicture.CreateImageFromFile("c:\multipagetif.tif")
nThumbnailID = ogdpicture.MakeThumbnail(150,150)
GdViewer1.SetNativeImage(ogdpicture.GetNativeImage)
Best regards,

Loïc

rassekst
Posts: 15
Joined: Thu Oct 04, 2007 6:58 pm

Post by rassekst » Thu Oct 04, 2007 7:07 pm

Hi,

I have test the code for viewing thumbnails.

following problems:
1. poor quality of the thumbnails for s/w 300dpi
2. very big memory usage 4 pages (1,16 MByte) is in memory 181 MByte

is this mormal?

Thank you for the answers

Steffen

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Fri Oct 05, 2007 10:09 am

Hi,

you are right the sample is not very optimised.

Try this code instead:

Code: Select all

Option Explicit



Private Sub cmdLoad_Click()
    Dim LstImgX As ListImage
    Dim nCpt As Long
    Dim nThumbnailID As Long, nTifImageID As Long

    CommonDialog1.FileName = ""
    CommonDialog1.InitDir = App.Path
    CommonDialog1.DialogTitle = "Open Tif Image"
    CommonDialog1.CancelError = False
    CommonDialog1.Filter = "TIFF Images(*.tif,*.tiff)|*.tif;*.tiff|" + _
                               "All Files (*.*)|*.*|"
    CommonDialog1.ShowOpen

    ImageList1.ImageWidth = 128
    ImageList1.ImageHeight = 96
    nTifImageID = Imaging1.CreateImageFromFile(CommonDialog1.FileName)
    If nTifImageID <> 0 Then
       For nCpt = 1 To Imaging1.TiffGetPageCount
           Imaging1.TiffSelectPage (nCpt)
           nThumbnailID = Imaging1.MakeThumbnail(200, 200)
           Imaging1.SetNativeImage (nThumbnailID)
           nThumbnailID = Imaging1.GetNativeImage
           Set LstImgX = ImageList1.ListImages.Add(, "image" & Trim(nCpt), Imaging1.GetPicture)
           ListView1.ListItems.Add , "image" & Trim(nCpt), "image" & Trim(nCpt), "image" & Trim(nCpt), 1
           Imaging1.CloseImage (nThumbnailID)
           Imaging1.SetNativeImage (nTifImageID)
       Next nCpt
       Imaging1.TiffSelectPage (1)
       GdViewer1.DisplayFromImageRef (Imaging1.GetNativeImage())
    End If
    cmdLoad.Visible = False
End Sub



Private Sub ListView1_Click()
    GdViewer1.DisplayFrame (ListView1.SelectedItem.Index)
End Sub


For the next release i will add these 2 methods:

- CreateThumbnailHQ
- MakeThumbnailHQ

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest