I'm having the following situation
after scanning some pages using Gdpicture And TWAIN plugin If I resize the form the image disapear. Refresh or DoEvents do nothing. If before resize the form I rotate the image, from this point on everything works fine.
I'm using the code exemple that are provide by Gdpicture.
If need I can send the code used.
I did not install the new release 9.2.
Ano help is welcome.
Regards
Rogerio
GdpictureImaging And TWAIN
Re: GdpictureImaging And TWAIN
This is the code: (Some words are in Portuguese)
(Buttom Scanning page)
Private Sub tsbDigitalizar_Click(sender As System.Object, e As System.EventArgs) Handles tsbDigitalizar.Click
'Armadilha para não sumir a imagem no resize do form (ver com a GDpicture o que pode ser isto)
bPrimeiraVez = True
If OpenSelectedSource() Then
subConfigurarScaneamento()
oGdPicturePDF.NewPDF() 'Cria um novo arquivo PDF vazio
Do
ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
If ImageID <> 0 Then
Call ApplyImageFilters(ImageID)
If ImageID <> 0 Then
If chkPreview.CheckState = 1 Then Call DisplayImage(ImageID)
Call oGdPicturePDF.AddImageFromGdPictureImage(ImageID, False, True)
'Libera os recursos usados pelo componete
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End If
End If
Loop While oGdPictureImaging.TwainGetState > TwainStatus.TWAIN_SOURCE_ENABLED
End If
End Sub
Private Sub DisplayImage(ByVal ImageID As Integer)
Call DocsView.DisplayFromGdPictureImage(ImageID)
DocsView.CloseDocument(True) 'Mostra o documento digitalizado, fecha mas continua mostrando
System.Windows.Forms.Application.DoEvents()
End Sub
This is a "trap" I'm using to keep the image displayed
Form resize event
Private Sub DocsScanUC_SizeChanged(sender As Object, e As System.EventArgs) Handles Me.SizeChanged
If bPrimeiraVez Then
bPrimeiraVez = False
tsbGirar270_Click(sender, e)
tsbGirar90_Click(sender, e)
End If
DocsView.SetZoomHeightViewer()
End Sub
(Buttom Scanning page)
Private Sub tsbDigitalizar_Click(sender As System.Object, e As System.EventArgs) Handles tsbDigitalizar.Click
'Armadilha para não sumir a imagem no resize do form (ver com a GDpicture o que pode ser isto)
bPrimeiraVez = True
If OpenSelectedSource() Then
subConfigurarScaneamento()
oGdPicturePDF.NewPDF() 'Cria um novo arquivo PDF vazio
Do
ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
If ImageID <> 0 Then
Call ApplyImageFilters(ImageID)
If ImageID <> 0 Then
If chkPreview.CheckState = 1 Then Call DisplayImage(ImageID)
Call oGdPicturePDF.AddImageFromGdPictureImage(ImageID, False, True)
'Libera os recursos usados pelo componete
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End If
End If
Loop While oGdPictureImaging.TwainGetState > TwainStatus.TWAIN_SOURCE_ENABLED
End If
End Sub
Private Sub DisplayImage(ByVal ImageID As Integer)
Call DocsView.DisplayFromGdPictureImage(ImageID)
DocsView.CloseDocument(True) 'Mostra o documento digitalizado, fecha mas continua mostrando
System.Windows.Forms.Application.DoEvents()
End Sub
This is a "trap" I'm using to keep the image displayed
Form resize event
Private Sub DocsScanUC_SizeChanged(sender As Object, e As System.EventArgs) Handles Me.SizeChanged
If bPrimeiraVez Then
bPrimeiraVez = False
tsbGirar270_Click(sender, e)
tsbGirar90_Click(sender, e)
End If
DocsView.SetZoomHeightViewer()
End Sub
Who is online
Users browsing this forum: No registered users and 2 guests