Hello all.
I have been looking around the forum for some info on image capture on Android....most of what I find is a bit old.
Is anyone around the forum using live code successfully to capture images into an app?
I would appreciate any help in this area. Image capture on iOS is not a problem but I cant get it right with any Android device.
Thanks in anticipation
gpjma
image capture on android devices
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: image capture on android devices
Hi gpjma,
A standard export snapshot command works. For example, something like this:
Many more variations are possible.
Kind regards,
Mark
A standard export snapshot command works. For example, something like this:
Code: Select all
on mouseUp
createImage
end mouseUp
on createImage
if there is an image "Test" then delete image "Test"
export snapshot from this cd to myPict as PNG
set the text of the templateImage to myPict
put rescale(the formattedwidth of the templateImage,the formattedHeight of the templateImage,100,100) into myWH
set the rect of the templateImage to 0,0 & comma & myWH
set the loc of the templateImage to the loc of this cd
set the showBorder of the templateImage to true
set the name of the templateImage to "Test"
create img
end createImage
function rescale theImgWidth,theImgHeight,theCdWidth,theCdHeight
if theCdWidth/theImgWidth < theCdHeight/theImgHeight then
put theCdWidth / theImgWidth into myRatio
else
put theCdHeight / theImgHeight into myRatio
end if
put theImgWidth * myRatio into myNewWidth
put theImgHeight * myRatio into myNewHeight
return myNewWidth,myNewHeight
end rescale
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Livecode Opensource Backer
- Posts: 38
- Joined: Sun Jan 01, 2012 11:48 pm
- Location: Brisbane Autralia
Re: image capture on android devices
Hi Mark
Many thanks for the reply.
I have tried a few methods but have one issue or another.
My app requires the user to take a photo and log it with a report nothing too difficult I guess.
I will let you know how I get on.
Thanks again.
Grahame
Many thanks for the reply.
I have tried a few methods but have one issue or another.
My app requires the user to take a photo and log it with a report nothing too difficult I guess.
I will let you know how I get on.
Thanks again.
Grahame
Re: image capture on android devices
Hi Grahame,
I understand it now. You need access to the camera. That's something completely different from what I wrote of course. Doesn't the mobilePickMedia command work for you? Could you write a little more about what you have tried so far?+
Kind regards,
Mark
I understand it now. You need access to the camera. That's something completely different from what I wrote of course. Doesn't the mobilePickMedia command work for you? Could you write a little more about what you have tried so far?+
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Livecode Opensource Backer
- Posts: 38
- Joined: Sun Jan 01, 2012 11:48 pm
- Location: Brisbane Autralia
Re: image capture on android devices
Hi Mark
Thanks.
Yes that's what I want to do but the code snippet you gave me will come in handy in another part of the program.
I will get back with what I am trying in a day or so as I am traveling between work sites at the moment.
Many thanks again for taking the time.
Cheers
Grahame
Thanks.
Yes that's what I want to do but the code snippet you gave me will come in handy in another part of the program.
I will get back with what I am trying in a day or so as I am traveling between work sites at the moment.
Many thanks again for taking the time.
Cheers
Grahame