Page 1 of 1

Invisible camera control

Posted: Thu Feb 15, 2018 6:01 pm
by Peter@multidesk.se
When I create a camera control with "cameraControlCreate" it works perfectly in iOS
but when I do the same on my Android phone, the preview does not appear.
I can take a photo, which confirm the function itself is present, but it is not visual.

This is the first time I try to use. "cameraControlCreate" I have previously used
mobilePickPhoto to capture pictures with the phone, so I do not know what to expect.

What could be wrong?

///Peter

Re: Invisible camera control

Posted: Fri Feb 16, 2018 1:26 am
by quailcreek
I haven't used cameraControlCreate before either but after seeing your post I thought I'd take a look. I can't get it to work correctly on either my iPhone or my Android. Would you please share your code? What LC version are you sunning?

Re: Invisible camera control

Posted: Fri Feb 16, 2018 8:34 am
by Peter@multidesk.se
I am running Lc Business edition 9.0.0 (dp11)


on openCard
if the environment is "mobile"
then
get the rect of image "rect"
cameraControlCreate "mobCam"
cameraControlSet "mobCam", "visible", true
cameraControlSet "mobCam", "rect", it
cameraControlSet "mobCam", "device", "back"
end if
end openCard


##### For some reason, the control does not appear (on iOS) before I run this button script #####

on mouseUp pButtonNumber
put cameraControlGet ("mobCam", "visible") into tStatus
if tStatus is true
then
cameraControlDo "mobCam", "takePicture"
cameraControlSet "mobCam", "visible", false
put the result into image "rect"
set the text of image "rect2" to the text of image "rect"
set the angle of image "rect2" to 270
else
put "" into image "rect"
put "" into image "rect2"
cameraControlSet "mobCam", "visible", true
end if
end mouseUp



///Peter

Re: Invisible camera control

Posted: Tue Mar 13, 2018 8:07 pm
by gagsoft
Hi Guys
I am wondering if there is a way to lower the camera resolution on iOS using LC script.
Busy tinkering with an app that takes photos of till slips and saves it on remote server.
I do not need high res photos.

Thanks
Peter G

Re: Invisible camera control

Posted: Wed Mar 14, 2018 11:17 am
by Peter@multidesk.se
Hi Peter G,


create an image "imageholder"
set the size to 375 x 670, or whatever size you want
set the position of it to -2000, -2000
lock the size and position of it

and then you just...

set the text of image "imageholder" to the text of the last image of this card
export image "imageholder" to imageToUpload as jpeg
delete the last image of this card


///Peter

Re: Invisible camera control

Posted: Wed Mar 14, 2018 2:25 pm
by gagsoft
Hi Peter
Thank yiu for your pointer

Much appreciated

Best
Peter