Capturing & Saving Images on Android
Posted: Mon Mar 02, 2015 6:26 pm
Hi,
Possibly someone can give me a little direction here to get me over the hump with using the camera on Android. I simply want to capture and image with the camera, then be able to save it and retrieve it later. I've tried to research the topic but have come up with sketchy information on how to handle image capture, and exactly what to do with the template image and image objects. It's a little like trying to figure out what a fly is seeing by being able to examine only a random sample of a few individual lenses.
Here is the code I've been experimenting with. It yields good results and returns an image as expected and displays it, but two or three subsequent attempts at capturing images from the camera without rebooting the app result making the process dysfunctional. That is, I get slow response or no response from the process. I suspect I'm not deleting the old images and quickly depleting resources, but I'm not sure about that or what to do about it.
"myimage.jpg" is an image object created with the same dimensions as the template image.
on mouseUp
set the lockloc of the templateimage to true
set the width of the templateimage to "300"
set the height of the templateimage to "400"
set the left of the templateimage to "10"
set the top of the templateimage to "10"
mobilePickPhoto "camera"
put the result into image "myimage.jpg"
reset the templateImage
end mouseUp
Thank you for the help!
Possibly someone can give me a little direction here to get me over the hump with using the camera on Android. I simply want to capture and image with the camera, then be able to save it and retrieve it later. I've tried to research the topic but have come up with sketchy information on how to handle image capture, and exactly what to do with the template image and image objects. It's a little like trying to figure out what a fly is seeing by being able to examine only a random sample of a few individual lenses.
Here is the code I've been experimenting with. It yields good results and returns an image as expected and displays it, but two or three subsequent attempts at capturing images from the camera without rebooting the app result making the process dysfunctional. That is, I get slow response or no response from the process. I suspect I'm not deleting the old images and quickly depleting resources, but I'm not sure about that or what to do about it.
"myimage.jpg" is an image object created with the same dimensions as the template image.
on mouseUp
set the lockloc of the templateimage to true
set the width of the templateimage to "300"
set the height of the templateimage to "400"
set the left of the templateimage to "10"
set the top of the templateimage to "10"
mobilePickPhoto "camera"
put the result into image "myimage.jpg"
reset the templateImage
end mouseUp
Thank you for the help!