1. JOSE WILLIAM ROMERO OLIVOS
  2. PowerBuilder
  3. Wednesday, 27 September 2023 21:17 PM UTC
Good day everyone. Since 2010 I have been using an ocx to take photos from a webcam.

In one section the video from the webcam is presented to me and with a button I take the image.

At the moment, videos have been working for many years, but I fear that over time the ocx will become obsolete.

Do you have any option that handles powerbuilder 2022 directly?


Any example of webcam management in Windows 11 with Powerbuilder 2022?
 
mike S Accepted Answer Pending Moderation
  1. Wednesday, 27 September 2023 21:30 PM UTC
  2. PowerBuilder
  3. # 1

Does your webcam have twain drivers available?  Most often do.

your options then are to use a twain interface, and there are various options on the market for that.  most are .net, some are dlls.

or you can use twain direct which is free but very new.  There is free software available to allow any connected device that uses twain to support the new twain direct REST api.  (in the future, webcams may come with twain direct embedded for driverless suport).  anyway, with that you can use the twain direct rest api to control the webcam and retrieve pictures. The downside is that all images are returned as PDF, so if you want non-pdf you would need something to extract out the jpeg pdf image.

 

or use something like wia and write c# code that you can call from PB 2021+

Take a picture automatically using a webcam in C# using WIA - Stack Overflow

Comment
There are no comments made yet.
JOSE WILLIAM ROMERO OLIVOS Accepted Answer Pending Moderation
  1. Wednesday, 27 September 2023 21:37 PM UTC
  2. PowerBuilder
  3. # 2

A big disadvantage of course, because currently I capture the image in bmp format and compress it by converting it to jpg format

I insert that image into a data window later, which means that with the PDF I will hardly be able to do it.

But, the WS will surely evolve and over time I imagine they will return in the format requested.

Thanks for the information, with that basis, you can start investigating

Comment
  1. mike S
  2. Thursday, 28 September 2023 11:17 AM UTC
in the meantime you can always write your own c# tool that you call to extract the jpeg. there are various free libraries available to do that. I have asked the twain direct standards people to add jpeg as a supported document type. Hopefully a future version will include it. I have also asked appeon to add an image extractor feature in the pdf object in PB, but that could be fairly complex given that the pdf can be many pages and each page can have a lot of elements.
  1. Helpful
There are no comments made yet.
Roy Bungert Accepted Answer Pending Moderation
  1. Thursday, 28 September 2023 06:15 AM UTC
  2. PowerBuilder
  3. # 3

Take a look at this tool: https://batchloaf.wordpress.com/commandcam/

You can run commandcam via the Run()-statement.

If you want to convert, edit or crop the picture you can use ImageMagick https://imagemagick.org/index.php

HTH 

Roy

 

Comment
There are no comments made yet.
Matt Kleweno Accepted Answer Pending Moderation
  1. Friday, 29 September 2023 13:22 PM UTC
  2. PowerBuilder
  3. # 4

I have been looking for an inexpensive (~$200 or less) webcam with a TWAIN driver for a few days.  I have seen a couple that are described as "TWAIN compatible", but do not explicitly say they come with a TWAIN driver.  The TWAIN compatible webcams are intended to be used with stand-alone photo ID systems, so I would guess the photo ID systems take care of the TWAIN driver issue.  If you have an example of a webcam that includes a TWAIN driver, that would be most appreciated. 

Comment
There are no comments made yet.
James Beck Accepted Answer Pending Moderation
  1. Friday, 6 September 2024 17:23 PM UTC
  2. PowerBuilder
  3. # 5

We have been able to implement a simple htm page using the webbrowser object and it has been working pretty good.    You can reference the simple htm page here:
https://ap-mobile.com/cdiBtmApps/webcam.htm

we register the ue_capture_trigger event and when the user clicks the take picture button, we are able to access the webcam_image.png in the downloads folder and load into a Picture Object.

webbrowser.navigationCompleted Event:

Integer li_result

li_result = wb_1.RegisterEvent("ue_capture_trigger")


If li_result = 1 Then
Else
     messagebox("Error", "Failed to register the event.")
End If

 

We were previously using the implementation from http://anvil-of-time.com/wordpress/powerbuilder/powerbuilder-capture-images-from-webcam/ and this seems to work much better.

Thanks
Jim

Comment
  1. Chris Pollach @Appeon
  2. Friday, 6 September 2024 19:19 PM UTC
Hi Jim .. that is a very "kool" tip - thanks!
  1. Helpful
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.