Thumbnails
Thumbnails
Can your component show multipage Tif files as thumbnails?
Thanks
Jaques
Thanks
Jaques
Hi,
You can do that with the GdPicture Pro component:
https://gdpicture.com/references/gdpictu ... bnail.html
ex:
Best regards,
Loïc
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)
Loïc
Hi,
you are right the sample is not very optimised.
Try this code instead:
For the next release i will add these 2 methods:
- CreateThumbnailHQ
- MakeThumbnailHQ
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
Who is online
Users browsing this forum: No registered users and 0 guests