1. Sivaprakash BKR
  2. PowerBuilder
  3. Sunday, 1 July 2018 04:14 AM UTC

Hello,

I need to capture images using the attached webcam [ desktop, laptop, ...]  and store that image in a database.  Smaller image size is preferable.

Currently I got Logitech C-170.   

Any idea how to accomplish this task ?  Should work in PB 11.5 and /or PB 2017.

Happiness Always

BKR Sivaprakash

 

Update 1:   Tried using EZTW32.DLL.

Results for the following commands.

ll_ret = TWAIN_IsAvailable()                         // Returns 1
ll_ret = TWAIN_LoadSourceManager()         // Returns 1
ll_ret = TWAIN_OpenSourceManager(0)      // Returns 1
ll_ret = TWAIN_OpenDefaultSource()          // Returns 0
ll_Ret = TWAIN_EnableSource(0)               // Returns 0
 

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

// Error
Unable to open default Data Source.
Source Manager operation failed.
RC:  TWRC_FAILURE
CC:  TWCC_NODS (No Data Source)

I plugged my webcam from the front size of the CPU.

This webcam works perfectly when tried with an Windev application.   

 

Update 2:  Using Windows 7 Ultimate SP1, 64-bit 

 

Accepted Answer
Sivaprakash BKR Accepted Answer Pending Moderation
  1. Wednesday, 28 November 2018 13:34 PM UTC
  2. PowerBuilder
  3. # Permalink

Hello,

Developed a small utility using another tool, called it passing required parameters, captured the image, stored it in a location, and read that file, displayed and stored in powerbuilder. 

 

Comment
  1. Roland Smith
  2. Wednesday, 28 November 2018 15:12 PM UTC
You could use ImageMagick. They have a COM object so you could run the commands using OLE.



https://www.imagemagick.org/script/ImageMagickObject.php

  1. Helpful
  1. Sivaprakash BKR
  2. Thursday, 29 November 2018 04:10 AM UTC
Thanks Roland,

ImageMagick won't help in capture those images, I think.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 3 July 2018 13:24 PM UTC
  2. PowerBuilder
  3. # 1

If you want to save space when saving images to the database, you can use ZLIB which is a free open source compression library. You'll need to also store the original size in the table as it is an argument to the uncompress function. I have an example here: http://www.topwizprogramming.com/freecode_zlibwapi.html

Comment
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Monday, 2 July 2018 10:08 AM UTC
  2. PowerBuilder
  3. # 2

Hi

This is not really a PB question as you will need some third party software outside of PB in order to capture, resize and save the image. Once it is done you can read the image into a blob and save it in the database.

Regards

Davids

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.