Loading...

Problems getting started with GDTwain

Support for GdTwain ActiveX and GdTwain Pro ActiveX/SDK.

Problems getting started with GDTwain

Postby tim » Wed Oct 22, 2008 7:03 pm

I need to build the facility to capture a single shot picture within a form and store it for display within the form. GDTwain looks as if it may be able to do the job so i have just downloaded the trial version and am having problems making it work.
Environment is VFP8.
Every time i try and save the captured picture to disk, it gives the licence number error message. I have tried applying the 30 day licence number but this has no effect so i guess i am diong something wrong there.
The provided VFP sample (acquire_single_image) doesn't work. It errors out on the "WITH" line right at the beginning.
I think i have registered the control correctly.
I have had some success just using "TwainAcquireToGdPictureImage" and "SaveAsJPEG" but have nto yet got to the point of trying to simplify the included form so it makes sense to my users or build it into the application yet. I need to solve the basic problems first.
tim
 
Posts: 6
Joined: Wed Oct 22, 2008 6:46 pm

Re: Problems getting started with GDTwain

Postby Loïc » Thu Oct 23, 2008 10:19 am

Hi Tim,

Code: Select all
Every time i try and save the captured picture to disk, it gives the licence number error message.


Just call the SetLicenseNumber() method to unlock the component with your evaluation KEY. see: http://www.gdpicture.com/faq.php#G1

IE:

Code: Select all
oTwain = CREATEOBJECT("gdtwainpro2.twain")
with oTwain as gdtwainpro2.twain
     .SetLicenseNumber("LicenseKey")
     IF .TwainOpenDefaultSource()
        .TwainSetHideUI(.T.)
        .TwainSetCurrentPixelType(2)  &&Color
        nImageID = .TwainAcquireToGdPictureImage
        .SaveAsJpeg("c:\image.jpg")
        .TwainCloseSource
     ELSE
        MESSAGEBOX("Can't open default source")
     ENDIF
endwith



Best regards,

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

Re: Problems getting started with GDTwain. making progress

Postby tim » Fri Oct 24, 2008 1:33 am

Thanks - I had missed the "" around the licence number.
The code you posted matches the sample provided with the software and still does not work. It still crashes out with an error message at the WITH line.
I have been able to make TwainAcquireToGdPictureImage and SaveAsJPEG work though, which is getting close to what i need to achieve.
Is there any way to change or simplify the window that pops up for TwainAcquireToGdPictureImage - such as just having a single CAPTURE button rather than the options that exist there ?
I also found a reference to "chapter 2" giving instructions on what files to distribute with an application but i can not find any general or installation manual; just very basic descriptions of the actual functions and methods themselves. Do you know where this manual is or alternatively, what procedures have to be followed on an end-user machine to make this work there ?

Thanks.
tim
 
Posts: 6
Joined: Wed Oct 22, 2008 6:46 pm

Re: Problems getting started with GDTwain

Postby Loïc » Fri Oct 24, 2008 5:33 pm

Hi,

It still crashes out with an error message at the WITH line


OK, but what is the error message ? Maybe your vfp version doesn't support WITH ENWITH block ?

Is there any way to change or simplify the window that pops up for TwainAcquireToGdPictureImage - such as just having a single CAPTURE button rather than the options that exist there ?


This popup came from your TWAIN driver. You can chose to hide it using the TwainSetHideUI() method: http://guides.gdpicture.com/v5/gdtwainp ... ideUI.html



To see how to redistribute the GdTwain Pro Toolkit just check the first page of the reference guide: http://guides.gdpicture.com/v5/gdtwainp ... index.html

Best regards,

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


Return to GdTwain [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest