Link to home
Start Free TrialLog in
Avatar of cshorey
cshorey

asked on

Save a JPEG returned from EZTWAIN

Trying to save a scanned image as a JPEG file. I acquire the image using EZ TWAIN dll and get back a handle to a DIB. How do I take this handle to the DIB and save it to a JPEG file using the sample code:

http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm

I been trying to use the SAVEJPG method of the cDIBSECTION class but can't seem to figure out how to convert the handle to a DIB to a cDIBSECTION object so that I can pass that to the SAVEJPG method.

Also looked at FreeImage:
http://freeimage.sourceforge.net/download.html
All example in C++, couldn't figure them out. Need VB code examples

ASKER CERTIFIED SOLUTION
Avatar of Kavar
Kavar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of spike0xFF
spike0xFF

The 'Pro' version of EZTwain (http://www.dosadi.com/eztwain3.htm) is commercial, but can load & save JPEG files (and TIFF, PNG, etc.) - It uses the IJG's LibJpeg which is freely available.

[Disclaimer: I'm the author of EZTwain and EZTwain Pro.]