Page 1 of 1

How to transfer directly to WpfImageViewer

Posted: Mon Sep 09, 2019 11:48 pm
by xgecko
Hello,

I want to transfer the raw scan bitmap to the WpfImageViewer control. The only way I have found is to save the AcquiredImage to a file and then load from the file, but this is a real kludge. Is there a means by which I can directly transfer the image to the WpfImageViewer control?

Please advise.

Re: How to transfer directly to WpfImageViewer

Posted: Tue Sep 10, 2019 12:19 pm
by Alex
Hello,

You can get scanned image as System.Drawing.Bitmap object, create Vintasoft.Imaging.VintasoftImage object from System.Drawing.Bitmap object and pass Vintasoft.Imaging.VintasoftImage object to the WpfImageViewe control. Please see code sample in our WPF Imaging Demo.

Best regards, Alexander

Re: How to transfer directly to WpfImageViewer

Posted: Wed Sep 11, 2019 6:57 pm
by xgecko
I am working with the WPF library... so I do not think what you said applies to my project. I also found that I cannot instantiate a BitMapSource object for some reason, all I can do is a System.Windows.Media.Imaging.BitMapImage object which is derived from the BitMapImageSource.

And the WPFImageViewer does not seem to accept a BitMapImage.

So how do I directly transfer an image from the TWAIN object to the ImageViewer object in the WPF library?

Re: How to transfer directly to WpfImageViewer

Posted: Wed Sep 11, 2019 7:07 pm
by Alex
Hello,

The Vintasoft.Imaging.Wpf.VintasoftImageConverter.FromBitmapSource method (https://www.vintasoft.com/docs/vsimagin ... ource.html) allows to convert the System.Windows.Media.Imaging.BitmapSource object (System.Windows.Media.Imaging.BitmapImage) to the Vintasoft.Imaging.VintasoftImage object.
Please use this method and let me know if you will have any question or problem.

Best regards, Alexander