We recently picked up an Epson GT-20000 scanner.
Which works real nice and for the most part works great with GdPicture.
It is the first scanner we have had that can, realistically, do High Res Scans.
Now this is not something that we be using the scanner for every day.
I suspect it will rarely be used above 600dpi.
It works fine with my program up to 1200 dpi.
At 2400 dpi, After the page is scanned and displayed in the viewer,
I get an error about an invalid page size and then a "Generic" GDI+ error.
I have not tracked it down exactly but I believe the error is happening in the thumbnail creation.
Is there any special handling I should be doing for hi-res scans?
Here is my thumbnail generation.
- Code: Select all
Dim nThumbnailID As Integer
Dim nCpt As Integer
Dim thumbWidth As Integer = 78
Dim thumbHeight As Integer = 100
Dim imageWidth As Integer = 82
Dim imageHeight As Integer = 100
Dim page As PVI.page
Dim Wait As New WaitCursor
ImageList1.ImageSize = New Size(thumbWidth, thumbHeight)
ImageList1.Images.Clear()
lvThumbnail.Items.Clear()
If nImageId <> 0 Then
Viewer1.ZoomMode = GdPicturePro5.ViewerZoomMode.ZoomFitToControl
For nCpt = 1 To pviGdPicture.Imaging1.TiffGetPageCount(nImageId)
pviGdPicture.Imaging1.TiffSelectPage(nImageId, nCpt)
nThumbnailID = pviGdPicture.Imaging1.CreateThumbnailHQEx(nImageId, imageWidth, imageHeight, GdPicturePro5.Colors.LightGray)
pviGdPicture.Imaging1.SetNativeImage(nThumbnailID)
Call ImageList1.Images.Add("", Bitmap.FromHbitmap(CType(pviGdPicture.Imaging1.GetHBitmap, IntPtr)))
Call lvThumbnail.Items.Add(nCpt.ToString, nCpt - 1) ' has the page number under thumbnail.
pviGdPicture.Imaging1.CloseImage(nThumbnailID)
page = New page
page.Brightness = 20
page.Contrast = 20
page.Luminance = 20
page.Saturation = 20
pImage.pages.Insert(nCpt - 1, page)
Next nCpt
pviGdPicture.Imaging1.SetNativeImage(nImageId)
pviGdPicture.Imaging1.TiffSelectPage(nImageId, 1)
Viewer1.SetNativeImage(nImageId)
End If
Me.lvThumbnail.LargeImageList = ImageList1
' After populating always select first image.
Me.lvThumbnail.Items(0).Selected = True
CType(Wait, IDisposable).Dispose()
Thanks
