Posts: 230
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: 439
Threads: 17
Joined: Apr 2022
Reputation:
21
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.
Ask me about Windows API and maybe some Linux stuff
Posts: 1,616
Threads: 157
Joined: Apr 2022
Reputation:
77
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: 439
Threads: 17
Joined: Apr 2022
Reputation:
21
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.
Ask me about Windows API and maybe some Linux stuff
Posts: 230
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: 1,616
Threads: 157
Joined: Apr 2022
Reputation:
77
And Spriggsy comes through again, +2
Pete
Posts: 439
Threads: 17
Joined: Apr 2022
Reputation:
21
(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.
Ask me about Windows API and maybe some Linux stuff