Invisible camera control

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Invisible camera control

Post by Peter@multidesk.se » Thu Feb 15, 2018 6:01 pm

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
/*Whats all the fuss with c# ?*/

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm
Location: McKenna, WA

Re: Invisible camera control

Post by quailcreek » Fri Feb 16, 2018 1:26 am

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?
Tom
MacBook Pro OS Mojave 10.14

Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Re: Invisible camera control

Post by Peter@multidesk.se » Fri Feb 16, 2018 8:34 am

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
/*Whats all the fuss with c# ?*/

gagsoft
Posts: 168
Joined: Sat Jun 29, 2013 7:56 pm

Re: Invisible camera control

Post by gagsoft » Tue Mar 13, 2018 8:07 pm

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

Peter@multidesk.se
Posts: 136
Joined: Fri Oct 14, 2011 6:53 am

Re: Invisible camera control

Post by Peter@multidesk.se » Wed Mar 14, 2018 11:17 am

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
/*Whats all the fuss with c# ?*/

gagsoft
Posts: 168
Joined: Sat Jun 29, 2013 7:56 pm

Re: Invisible camera control

Post by gagsoft » Wed Mar 14, 2018 2:25 pm

Hi Peter
Thank yiu for your pointer

Much appreciated

Best
Peter

Post Reply

Return to “Android Deployment”