I can't seem to figure out how to display multiple pages from 1 tif document in the same viewer using vb 2008. Is this possible?
As a side note what is the difference between GDPicturePro5 and GDPicturePro5S (Safe)?
Thanks.
show multipage tif in 1 viewer
Re: show multipage tif in 1 viewer
Hi,
Here a sample to draw all the page of a multipage tiff image on a new image which is displayed into a GdViewer object.
Best regards,
Loïc
Here a sample to draw all the page of a multipage tiff image on a new image which is displayed into a GdViewer object.
Code: Select all
Dim nTiffImage As Long
Dim nTiffImagePageCount As Long
Dim nHeightOfOnePage As Long
Dim nWidthOfOnePage As Long
Dim I As Long
Dim nCanvaHeight As Long
Dim nCanvaWidth As Long
Dim nCanvaImage As Long
Imaging1.TiffOpenMultiPageAsReadOnly (True)
nTiffImage = Imaging1.CreateImageFromFile("D:\projets\gdpicture\images de test\mainfile.tif")
Imaging1.SetNativeImage (nTiffImage)
nTiffImagePageCount = Imaging1.TiffGetPageCount(nTiffImage)
nHeightOfOnePage = Imaging1.GetHeight
nWidthOfOnePage = Imaging1.GetWidth
nCanvaHeight = nHeightOfOnePage * nTiffImagePageCount
nCanvaWidth = Imaging1.GetWidth
nCanvaImage = Imaging1.CreateNewImage(nCanvaWidth, nCanvaHeight, 24, White)
Imaging1.SetNativeImage (nCanvaImage)
For I = 1 To Imaging1.TiffGetPageCount(nTiffImage)
Call Imaging1.TiffSelectPage(nTiffImage, I)
Call Imaging1.DrawImage(nTiffImage, 0, (I - 1) * nHeightOfOnePage, nWidthOfOnePage, nHeightOfOnePage, InterpolationModeNearestNeighbor)
Next I
Imaging1.CloseImage (nTiffImage)
GdViewer1.SetNativeImage (nCanvaImage)
Best regards,
Loïc
Re: show multipage tif in 1 viewer
thanks for the code, it helped out tremendously for one of my pages, but i should have been a little more descriptive
i am using 2 viewers the first one to show an existing multipage tif document the second one to show another single or multipage tif document(s). i want to use the second viewer to add or delete pages to the first viewer, i also want to be able to grab and reorder pages in the first viewer. i understand this is quite a bit of stuff going on here but i am converting an existing process from vb6 to vb 2008. thanks again.
i am using 2 viewers the first one to show an existing multipage tif document the second one to show another single or multipage tif document(s). i want to use the second viewer to add or delete pages to the first viewer, i also want to be able to grab and reorder pages in the first viewer. i understand this is quite a bit of stuff going on here but i am converting an existing process from vb6 to vb 2008. thanks again.
Who is online
Users browsing this forum: No registered users and 1 guest