Thumbnails and .Net
Thumbnails and .Net
Hi,
Have you an example of how to generate thumbnail images from in a .Net application. I don't care whether it is VB.Net or C#. By the way Version 5 sounds perfect for what I am doing.
Keep up the great work
regards
Shaun
Have you an example of how to generate thumbnail images from in a .Net application. I don't care whether it is VB.Net or C#. By the way Version 5 sounds perfect for what I am doing.
Keep up the great work
regards
Shaun
Re: Thumbnails and .Net
Hi shaun.
You can install the full package of the GdPicture Pro SDK: https://www.gdpicture.com/download/downl ... urepro.php
Open the "_Global_sample" project include into the samples/vb.net directory and look the DrawPreview() function wich shows an usage of the MakeThumbnail() method.
Regards,
Loïc
You can install the full package of the GdPicture Pro SDK: https://www.gdpicture.com/download/downl ... urepro.php
Open the "_Global_sample" project include into the samples/vb.net directory and look the DrawPreview() function wich shows an usage of the MakeThumbnail() method.
Code: Select all
nThumbImageHandle = Imaging1.MakeThumbnail(150, 150)
Regards,
Loïc
Re: Thumbnails and .Net
Hi Loic,
Sorry, my fault. I should have been more specific. I am trying to do something very similar to your VB6 thumbnail sample but in .Net code. I scan multipage documents and would like to show a thumbnail image of each page similar to adobe reader etc.
I believe that creating a collection of imageviewer objects might be too resource hungry as some of these documents can be over 100 pages in length
regards
Shaun
Sorry, my fault. I should have been more specific. I am trying to do something very similar to your VB6 thumbnail sample but in .Net code. I scan multipage documents and would like to show a thumbnail image of each page similar to adobe reader etc.
I believe that creating a collection of imageviewer objects might be too resource hungry as some of these documents can be over 100 pages in length
regards
Shaun
Re: Thumbnails and .Net
Hi Shaun,
I done a conversion from the vb6 thumbnail sample to VB.NET.
- Start a new project.
- Add an AxImaging object to your form (AxImaging1)
- Add an AxGdViewer object to your form (AxGdViewer1)
- Add a Button object (Button1)
- Add a ListView object (ListView1)
- Add an OpenFileDialog object (OpenFileDialog1)
- Add an ImageList object (ImageList1)
And copy this code into Form1:
It is just a basic (but fast) way to get thumbnail images list from a multipage tiff file using the std vb.net objects.
I think we can get better result using GdViewer objects to show thumbnails...
Best regards,
Loïc Carrère
I done a conversion from the vb6 thumbnail sample to VB.NET.
- Start a new project.
- Add an AxImaging object to your form (AxImaging1)
- Add an AxGdViewer object to your form (AxGdViewer1)
- Add a Button object (Button1)
- Add a ListView object (ListView1)
- Add an OpenFileDialog object (OpenFileDialog1)
- Add an ImageList object (ImageList1)
And copy this code into Form1:
Code: Select all
Public Class Form1
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
For i As Integer = 0 To ListView1.Items.Count - 1
If ListView1.Items.Item(i).Selected = True Then
AxGdViewer1.DisplayFrame(i + 1)
Return
End If
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim nImageID As Long
Dim nThumbnailID As Long
Dim nCpt As Integer
OpenFileDialog1.Filter = "Tiff Files|*.tif"
OpenFileDialog1.ShowDialog()
nImageID = AxImaging1.CreateImageFromFile(OpenFileDialog1.FileName)
ImageList1.ImageSize = New Size(100, 100)
ImageList1.Images.Clear()
ListView1.Items.Clear()
If nImageID <> 0 Then
AxGdViewer1.ZoomMode = GdPicturePro5.ViewerZoomMode.ZoomFitToControl
For nCpt = 1 To AxImaging1.TiffGetPageCount(nImageID)
AxImaging1.TiffSelectPage(nImageID, nCpt)
nThumbnailID = AxImaging1.CreateThumbnailHQ(nImageID, 100, 100)
AxImaging1.SetNativeImage(nThumbnailID)
Call ImageList1.Images.Add("", Bitmap.FromHbitmap(AxImaging1.GetHBitmap))
Call ListView1.Items.Add("", nCpt - 1)
AxImaging1.CloseImage(nThumbnailID)
Next nCpt
AxImaging1.TiffSelectPage(nImageID, 1)
AxGdViewer1.SetNativeImage(nImageID)
End If
ListView1.LargeImageList = ImageList1
End Sub
End Class
It is just a basic (but fast) way to get thumbnail images list from a multipage tiff file using the std vb.net objects.
I think we can get better result using GdViewer objects to show thumbnails...
Best regards,
Loïc Carrère
Re: Thumbnails and .Net
Hi Loïc,
Thank you! This will do brilliantly.
regards
Shaun
Thank you! This will do brilliantly.
regards
Shaun
Re: Thumbnails and .Net
How would you modify this code to work with PDF files?
Thanks,
Neil
Thanks,
Neil
Who is online
Users browsing this forum: No registered users and 1 guest