mobilePickPhoto "library" not playing nicely

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

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
cusingerBUSCw5N
Posts: 336
Joined: Wed Jul 11, 2012 9:24 pm

mobilePickPhoto "library" not playing nicely

Post by cusingerBUSCw5N » Tue Sep 25, 2012 5:20 pm

I am trying to get an existing photo on an android and save it to an external source.

So...here is my code so far:
if the environment is "mobile" then
set the name of the templateimage to "The_Image"
set the width of the templateimage to 200
set the height of the templateimage to 200

# Now this will produce a new image named "The_Image" in 200*200 pixels on the current card!
mobilePickPhoto "library"

## Now check for errors!
if the result<> EMPTY then
put the result into field "The_Result"
else
answer "this has failed"
end if
end if
I created a field "The_result"

So...when I test it on the android, the picture shows up in the top left corner - much bigger than the 200 x 200 set...
and my field "The_Result" is empty
and it answers "this has failed"
...

I would like to have the image is a specific location (not the top left corner) and I would like the name so that I can save it on an external source.

So...as usual, I'm stuck.

cusingerBUSCw5N
Posts: 336
Joined: Wed Jul 11, 2012 9:24 pm

Re: mobilePickPhoto "library" not playing nicely

Post by cusingerBUSCw5N » Wed Sep 26, 2012 3:09 am

This seems to work on an Android

Code: Select all

on mouseUp
   if the environment = "mobile" then
set the name of the templateimage to "harry"
set the loc of the templateimage to 400,100 -- or wherever you want it
mobilePickPhoto "camera" ,400 , 400
if the result = "" then 
-- ok do something with image "harry" here
      set the width of image "harry" to 400
      set the height of image "harry" to 400
      set the top of image "harry" to 400
      set the left of image "harry" to 100
set the border  of image "harry" to  true
set the threeD of image "harry" to false
set the borderwidth of image "harry" to  1
set the locklocation of the templateImage to false
       set vis of image "harry" to "true"
end if
end if
end mouseUp

Post Reply

Return to “Android Deployment”