Posts: 229
Threads: 25
Joined: Aug 2022
Reputation:
23
I don't know much about this topic of accessing PC/Mac/Linux devices.
Is it possible to capture a still image from a USB camera from within a QB64 program? Or would this be incredibly complicated? Obviously the easiest thing to do is just manually capture the image (using the camera software) then _loadimage into QB64.
I'm wondering if QB64 could be used to capture a new image at a certain time interval and discard the previous image.
Posts: 733
Threads: 30
Joined: Apr 2022
Reputation:
43
Yes. In Windows, one can capture an image from the webcam or even a video. It's a complicated API and I'd have to revisit it. If you are not in any rush then I can come back to you at a later date with information on this.
Tread on those who tread on you
Posts: 2,169
Threads: 222
Joined: Apr 2022
Reputation:
103
Does the still image appear on your screen? If so, in Windows you hold the Windows key and press the PrtScr key to capture the image and send it to the windows picture folder as a screen shot image. PrtScr by itself would capture the image to the image clipboard. My point is we already have API functions to mimic key presses to do this job in QB64, and QB64 has a keyword to communicate with the Windows clipboard image.
As far as actually controlling the USB camera in a QB64 program, no. Nothing I know of posted. If Spriggsy has an interface he'd have to dig into it, as he mentioned.
Pete
Posts: 733
Threads: 30
Joined: Apr 2022
Reputation:
43
11-22-2022, 03:02 PM
(This post was last modified: 11-22-2022, 03:03 PM by SpriggsySpriggs.)
So I found my post on the old forum where I did this. Can't remember if this is before or after I started doing only 64 bit code. If you're on 64 bit QB64 and it isn't working, just switch to 32 and try again.
https://qb64forum.alephc.xyz/index.php?t...#msg123574
However, that code definitely needs cleaning up. But this can help you fiddle around with it in the meantime.
Tread on those who tread on you
Posts: 229
Threads: 25
Joined: Aug 2022
Reputation:
23
Thanks! This worked immediately, using 64-bit v3.3
I'll study this code and see if I can make sense of it. Much appreciated - cheers!
Posts: 2,169
Threads: 222
Joined: Apr 2022
Reputation:
103
And Spriggsy comes through again, +2
Pete
Posts: 733
Threads: 30
Joined: Apr 2022
Reputation:
43
(11-22-2022, 04:11 PM)james2464 Wrote: Thanks! This worked immediately, using 64-bit v3.3
I'll study this code and see if I can make sense of it. Much appreciated - cheers!
@james2464
The only warning I can give with this code is that it captures a lossless file. So the file can get quite large if you let it run too long.
Tread on those who tread on you