Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Having trouble with SetDeviceCameraToImage for QR Codes

Author
Message
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 27th Sep 2017 08:09 Edited at: 27th Sep 2017 08:18
I'm trying to set the camera display to image and then to sprite but it doesn't seem to do much as the sprite is white when running.

I had to install the latest version of AppGameKit because AppGameKit player auto updated so I don't know if it's a new version bug or it's my device. The device has 2 cameras and GetNumDeviceCameras returns 2. I did see that GetDeviceCameraType(0), GetDeviceCameraType(1) and GetDeviceCameraType(2) all return 0. Not sure if that's the problem.

Can anyone see a problem with the code and if you have a few seconds are you able to test it to see if it works fine on your device please? I know there's no way of stopping the stream in the code below.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 27th Sep 2017 08:37

https://www.appgamekit.com/documentation/Reference/Image/SetDeviceCameraToImage.htm

AGK (Steam) V2017.09.25 : Windows 10 Pro 64 Bit : AMD (17.7.2) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 27th Sep 2017 09:41
@Markus, thanks again. I've now seen the problem. I fixed it by changing imgCamQR to equal 1 instead of 0 and in the CreateSprite I used 0 instead of imgCamQR. This code worked for me



I wanted to replace the image on the sprite continuously in a loop until exited because then I can scan QR codes in real time.

Login to post a reply

Server time is: 2024-04-19 08:21:59
Your offset time is: 2024-04-19 08:21:59