cancel
Showing results for 
Search instead for 
Did you mean: 

Scanning and viewing images from pb12.5 classic

Former Member
0 Kudos

I'm looking for a way to scan images, and view them in by powerbuilder 12.5 classic application.

I've seen some old discussions on this topic, and looking for more recent information.  We were using a tool called global 360, to

view image.  We are now looking to do scanning.  Global 360 is a bit dated, and has been sold a few times.   We also use a

pretty old version of global 360 which I'm surprised works on windows 7.  So, I guess I'm looking

for a more updated tool.  I don't want to pass on a huge expense to our customers.  Does anyone have any thoughts on this?

I looking for something, that will hopefully have some examples on incorporating into powerbuilder. 

We are also looking to store these images up on our database, because we have a separate java based web product

that will be doing document stores on the database.

I'd appreciate any recommendations you can give.

thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Scot;

1) For viewing .. just use either the InkEdit or InkPicture controls (which are also supported in the DataWindow BTW).

2) For scanning .. I would recommend looking at EZTwain: Home of EZTwain

    (works great with PB!) 

HTH

Regards ... Chris

Former Member
0 Kudos

It looks like my company is using Acquire, which appears to be owned by the same company that does eztwain.   It looks to be a command line utility.

I can probably get the image, into a tif file.

Would you know of any examples of getting a tif file into the db, using inkpicture?

Former Member
0 Kudos

Hi Scot;

1)   EZTwain is an API:  EZTwain from PowerBuilder

2) Once you have a scanned Image file or blob - then use the LoadPicture ( ) method of the IEC/IPC.

Tip: EZTwain's "code wizard" will build the PowerScipt for you. 

Regards ... Chris

Former Member
0 Kudos

Hi

But the sample code is not available. Does anyone have this sample code for me? Thank You.

André Rust

Former Member
0 Kudos

Hi André;

1) I have an example I coded in PB I can send you if you like. Its built in PB version 12.1.

2) In the mean time .. here is a snippet:

Global Variables 

  long mCapHwnd 

  Constant LONG WM_CAP_DRIVER_CONNECT = 1034 

  Constant Long WM_CAP_DRIVER_DISCONNECT = 1035 

  Constant Long WM_CAP_GRAB_FRAME = 1084 

  Constant Long WM_CAP_EDIT_COPY = 1054 

  Constant Long WM_CAP_DLG_VIDEOFORMAT = 1065 

  Constant Long WM_CAP_DLG_VIDEOSOURCE = 1066 

  Constant String WM_CLOSE = 'H10' 

     

Global External Functions 

  FUNCTION long DIB_WriteToBmp(long hdib, string pz) LIBRARY 'EZTW32.DLL' alias for 'DIB_WriteToBmp;Ansi' 

  FUNCTION long TWAIN_AcquireNative(long hwndApp, uint wPixTypes) LIBRARY 'EZTW32.DLL' 

  FUNCTION long TWAIN_AcquireToClipboard (long hwndApp, uint wPixTypes)  LIBRARY 'EZTW32.DLL' 

  FUNCTION long TWAIN_AcquireToFilename (long hwndApp, string pz)  LIBRARY 'EZTW32.DLL' alias for 'TWAIN_AcquireToFilename;Ansi' 

  FUNCTION long TWAIN_FreeNative(long hdib)  LIBRARY 'EZTW32.DLL' 

  FUNCTION long TWAIN_SelectImageSource (long hwnd) LIBRARY 'EZTW32.DLL' 

  FUNCTION long TWAIN_SetSaveFormat(int nFF) LIBRARY 'EZTW32.DLL' 

     

Put a Picture button control (pb_1) and a Command button (cb_1) to capture the image. 

 

In the Clicked event of cb_1 : 

     

    long ll_ret 

    ll_ret = TWAIN_AcquireToFilename(0, "c:\temp\result.bmp") 

    pb_1.picturename='c:\temp\result.bmp' 

HTH

Regards ... Chris

Former Member
0 Kudos

Hi Chris,

yes pls.

André Rust

Former Member
0 Kudos

Send me an eMail (hover over my picture to get it) and I will zip it up for you.  

Former Member
0 Kudos

Hi Chris,

sorry but I can't see an eMail.

André Rust

Former Member
0 Kudos

Try again, I think I unblocked that OK.

Former Member
0 Kudos

ok, now you can block it again. I can read this. eMail was sent to you.

Former Member
0 Kudos

Let me know if you got the ZIP file example OK.

Former Member
0 Kudos

Hi Chris

do you send the example yet?

André Rust

Former Member
0 Kudos

Hi A;

  Yes, I sent it back as an attachment in a reply within a few minutes of receiving your email.

You might want to check your spam folder.

Regards ... Chris