I'm trying to use the CreateImageFromDIB method in the Imaging library. The DIB itself comes from my Twain scanning code. Whenever I try to call the create function it returns a value like: -858993459. If I use the same DIB with the GdViewer->DisplayFromGdiDib() function it loads and displays ok.
The scenario is:
- Initiate scan
- As scan progresses send the DIB data to a preview callback
- Display the 'band' in the GdViewer with the DisplayFromGdiDib() call
- When the scan completes send the DIB data to a xfercomplete callback
- Attempt to load the DIB with CreateImageFromDIB
- Attempt to save the loaded DIB as a TIFF file
gdStatus like I mentioned is always returning a negative number. This code used to work. I've tried a number of the older versions of the library (5.11.4 thru the current version) with no success.
I've even tried loading the image from the GdViewer into the imaging library but that fails as well:
- Code: Select all
gdpImaging->SetNativeImage(m_gdViewer.GetNativeImage());
gdStatus = gdpImaging->SaveAsTIFF("C:\\Development\\Jimmy.tif", 0);
The only big change I've made is switching over to a ClassWizard generated wrapper for the GdPicturePro activex versus my own #import.
Any ideas why the viewer will load the DIB but not the Imaging library?
Thanks as always.

