Loading...

Problem with Imaging -> CreateImageFromDIB

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Problem with Imaging -> CreateImageFromDIB

Postby dcreeron » Fri Jul 17, 2009 6:45 am

Hi Loic,

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.
Daniel Creeron
Image
http://www.chocksettsoftware.com
Home of Paper Valet and Paper Valet Pro
<Sarcasm msg='Love that Paper Scan is very similar to my product!' />
dcreeron
 
Posts: 35
Joined: Tue Apr 14, 2009 7:55 pm
Location: Apex, NC

Re: Problem with Imaging -> CreateImageFromDIB

Postby Loïc » Fri Jul 17, 2009 5:32 pm

Hi Daniel,

Please, provide a code snippet to reproduce the error. I tested the method without founding any issue.

Whenever I try to call the create function it returns a value like: -858993459


Are you using int32 to store the returned value ?

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4437
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 2 guests