VSTwain1_ImageAcquired And Viewer
Posted: Thu Sep 04, 2008 7:41 am
What is the best way to add an acquired image to a Vintasoft.Imaging.ImageViewer?
I have placed the following code in the VSTwain1_ImageAcquired event and seems to work with an exception to gray scale images.
Private Sub VSTwain1_ImageAcquired(ByVal sender As Object, ByVal e As System.EventArgs) Handles VSTwain1.ImageAcquired
ImageViewer1.Images.Add(VSTwain1.GetImage(VSTwain1.NumImages - 1))
End Sub
The images show up fine in the ImageViewer. If I rotate the image using "Me.ImageViewer1.FocusedImage.Rotate(90)" the image rotates as expected. My problem is this. If the images scanned from the scanner are gray scale(8-bit) images, then after a rotate, the image becomes distorted with a red-ish overlay. Also if I scan and do nothing but save the image and then open it again, the image contains the distorted red-ish overlay. Here is the code I use to save to file. imageViewer1.Images.Save(Me.FilePath).
Note: I can duplicate the issue using the same code on two different hp scanner models.
I have placed the following code in the VSTwain1_ImageAcquired event and seems to work with an exception to gray scale images.
Private Sub VSTwain1_ImageAcquired(ByVal sender As Object, ByVal e As System.EventArgs) Handles VSTwain1.ImageAcquired
ImageViewer1.Images.Add(VSTwain1.GetImage(VSTwain1.NumImages - 1))
End Sub
The images show up fine in the ImageViewer. If I rotate the image using "Me.ImageViewer1.FocusedImage.Rotate(90)" the image rotates as expected. My problem is this. If the images scanned from the scanner are gray scale(8-bit) images, then after a rotate, the image becomes distorted with a red-ish overlay. Also if I scan and do nothing but save the image and then open it again, the image contains the distorted red-ish overlay. Here is the code I use to save to file. imageViewer1.Images.Save(Me.FilePath).
Note: I can duplicate the issue using the same code on two different hp scanner models.