Load multiple files
Load multiple files
Hi there,
can some show me how to load multiple tiff files into a viewer with and thumbnail viewer.
Thanks
pqsik
can some show me how to load multiple tiff files into a viewer with and thumbnail viewer.
Thanks
pqsik
Re: Load multiple files
Hi there,
I'm trying this but I'm not getting any images in the thumbnailEx1
Now I have to link the LstImage to a gdpicture viewer.
Do I have to loop the LstImage and add the images to a thumbnail viewer?
Thanks
pqsik
I'm trying this but I'm not getting any images in the thumbnailEx1
Code: Select all
dim LstImage as new List(of Integer)
For each file in FileCollection
LstImage.add(gdp.CreateGdPictureImageFromFile(file.name))
Next
For Each Item As Integer In LstImage
ThumbnailEx1.LoadFromGdPictureImage(Item)
Next
Now I have to link the LstImage to a gdpicture viewer.
Do I have to loop the LstImage and add the images to a thumbnail viewer?
Thanks
pqsik
Re: Load multiple files
I'm still looking for help with this.
Has anyone loaded multiple tiff files into a GdPictureImaging and showing them in a GdPicture thumbnail viewer and GdPicture viewer.
Can it be done?
Thanks
pqsik
Has anyone loaded multiple tiff files into a GdPictureImaging and showing them in a GdPicture thumbnail viewer and GdPicture viewer.
Can it be done?
Thanks
pqsik
Re: Load multiple files
Hi,
Just use the AddItemFromGdPictureImage method of the ThumbnailEx class.
Kind regards,
Loïc
Just use the AddItemFromGdPictureImage method of the ThumbnailEx class.
Kind regards,
Loïc
Re: Load multiple files
Thank for the reply Loic,
I tried that, but if the tiff file has multiple pages I don't see them in the thumbnail viewer Just one label, no image.
I can use the viewers pages/frames goto next to see them.
Do I have to get each tiff page and add to another GdPictureImaging and loop into the thumbnail viewer or I'm I taking this to far.
pqsik
I tried that, but if the tiff file has multiple pages I don't see them in the thumbnail viewer Just one label, no image.
I can use the viewers pages/frames goto next to see them.
Do I have to get each tiff page and add to another GdPictureImaging and loop into the thumbnail viewer or I'm I taking this to far.
pqsik
Re: Load multiple files
I have it working now, need to make sure there is no memory leaks.
Thank
pqsik
Code: Select all
gdp.SetLicenseNumber(SharedObject.L)
Dim ThisPath As String = DataLoader.LoadSettings().CertificateLocation
Dim intImage As Integer = 0
Dim Pos As Integer = 0
For Each item As SMProGageCertificate In DataLoader.LoadGageCertificate(ThisGageID)
If FolderHelper.DoesFileExist(Path.Combine(ThisPath, item.CertificateName)) Then
gdp.TiffOpenMultiPageForWrite(False)
intImage = gdp.CreateGdPictureImageFromFile(Path.Combine(ThisPath, item.CertificateName))
Dim TiffOutputID As Integer = 0
If gdp.TiffIsMultiPage(intImage) Then
Dim PageCount As Integer = gdp.TiffGetPageCount(intImage)
For j As Integer = 1 To PageCount
gdp.TiffSelectPage(intImage, j)
TiffOutputID = gdp.CreateClonedGdPictureImage(intImage)
LstImage.Add(New ValuePair(String.Format("Multiple tiff {0} of {1} {2} {3}", j, PageCount, vbCrLf, item.CertificateName), gdp.CreateClonedGdPictureImage(TiffOutputID), Pos))
gdp.ReleaseGdPictureImage(TiffOutputID)
Pos += 1
Next
Else
TiffOutputID = gdp.CreateClonedGdPictureImage(intImage)
LstImage.Add(New ValuePair(item.CertificateName, gdp.CreateClonedGdPictureImage(TiffOutputID), Pos))
gdp.ReleaseGdPictureImage(TiffOutputID)
Pos += 1
End If
End If
gdp.ReleaseGdPictureImage(intImage)
Next
Try
ThumbnailEx1.LoadFromGdPictureImage(-1)
Catch ex As Exception
If ThumbnailEx1.AllItemsLoaded Then
For Each Item As ValuePair In LstImage
ThumbnailEx1.AddItemFromGdPictureImage(Item.ItemValueInt)
ThumbnailEx1.SetItemText(Item.ItemPosition, Item.DisplayText)
Next
End If
End Try
and
Private Sub frmImage_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
For Each Item As ValuePair In LstImage
gdp.ReleaseGdPictureImage(Item.ItemValueInt)
Next
ThumbnailEx1.ClearAllItems()
End Sub
Thank
pqsik
Who is online
Users browsing this forum: No registered users and 2 guests