I have tried:
on mouseUp
## This is the only way to name an imge BEFORE it is created
set the name of the templateimage to "harry"
mobilePickPhoto "front camera" ,100 , 100
if the result <> empty then
--put the result into image "image1"
put "harry" into image "image1"
EXIT mouseup
end if
## Succes, now you can use the new image
end mouseUp
Whichever out method I use the image is not shown in image1 it is in the centre of the stack.
Also if I run the stack within livecode I get an error on line ' mobilePickPhoto "front camera" ,100 , 100 '
stating
Line 4 (Handler: can't find handler) near "mobilePickPhoto", char 1
Cheers
SteveW
Get image from mobile camera
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Get image from mobile camera
The image is created automatically, so you don't need to "put" it anywhere. It will always be in the middle of the stack unless you set the location of the templateImage beforehand, just like you set the name. Any property you need for the created image must be set in the template first.
So, you need to:
All the "mobile" commands will only work in mobile devices, they are not supported on the desktop. That is why you are getting an error. You need to separate the command depending on the environment that is currently running:
So, you need to:
Code: Select all
set the name of the templateimage to "harry"
set the loc of the templateimage to 10,10 -- or wherever you want it
mobilePickPhoto "front camera" ,100 , 100
if the result = "" then -- did not error
-- do something with image "harry" here
end if
Code: Select all
if the environment = "mobile" then
set the name of the templateimage to "harry"
set the loc of the templateimage to 10,10 -- or wherever you want it
mobilePickPhoto "front camera" ,100 , 100
if the result = "" then -- did not error
-- do something with image "harry" here
end if
end if
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Get image from mobile camera
Got that thanks.
I cannot get the camera to fire up in 2 different android 2.2 devices (phone & tablet) .
If I use:
mobileCameraFeatures
put the result into field "details4"
I get :
rear
photo
Although the tablet has a front camera.
This works on Iphone
set the name of the templateimage to "harry"
set the loc of the templateimage to 100,100
mobilePickPhoto "camera", 100,100
I cannot get the camera to fire up in 2 different android 2.2 devices (phone & tablet) .
If I use:
mobileCameraFeatures
put the result into field "details4"
I get :
rear
photo
Although the tablet has a front camera.
This works on Iphone
set the name of the templateimage to "harry"
set the loc of the templateimage to 100,100
mobilePickPhoto "camera", 100,100