I have three questions for you
1) I have a problem regarding memory deallocation. Executing the following code many times repetitively in Access 2003 - VBA causes Windows to go out of memory:
- Code: Select all
If GdPicture.TwainOpenDefaultSource = True Then
GdPicture.TwainSetErrorMessage True
GdPicture.TwainSetHideUI True
GdPicture.TwainSetCurrentPixelType TWPT_GRAY
GdPicture.TwainSetCurrentResolution 200
GdPicture.TwainSetCurrentBitDepth 8
nImageID = GdPicture.CreateImageFromTwain(Me.hwnd)
GdPicture.TwainCloseSourceManager (Me.hwnd)
If nImageID <> 0 Then
GdPicture.SaveAsByteArray [...]
gdViewer.ClosePicture 'Previous picture
gdViewer.DisplayFromImageRef nImageID
gdViewer.SetZoomWidth
gdViewer.SetVScrollBarPosition 0
end if
[...]
I create an image from scanner, close the previously opened picture in the viewer, then assign the newly created picture to gdViewer. With this code, each time, I close a picture created with gdPicture in gdViewer, but the picture remains loaded in memory. If I close the picture from gdPicture control, after it is loaded in gdViewer, I get an automation error if I work with the viewer.
2) The viewer works correctly if ViewerQuality = QualityLow. For other kind of qualities there are problems. For example, setting ViewerQuality = QualityBilinear causes scrolling to be slower than ViewerQuality = QualityBicubicHQ.
3) Are there any ways to do the following:
- Code: Select all
gdViewer.SetZoomWidth
gdViewer.SetVScrollBarPosition 0
and avoid the flikering produced by the second instruction?
Thanks very much for your support.
Kylex
