IOS PickPhoto

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

IOS PickPhoto

Post by Nakia » Tue Jun 05, 2012 1:41 pm

Hi All,

Trying to find some information on the mobilePickPhoto command.

I can issue the command etc, but I cant find much detail on how to deal with the actual image (IE save to a file in the documents directory of the app)

In my App i want to be able to launch this command, select a file from the library and then save it to the documents directory.
If I can achieve the above can i then populate an image area on another card by referencing this file?

Thanks in advanced.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: IOS PickPhoto

Post by Dixie » Tue Jun 05, 2012 3:33 pm

Nakia…

I have attached a stack… you can choose a photo from the library and then it saves it to the documents folder… I have just got the image to be named by the seconds when you made the choice… I'll leave you to sort out how you want to name the files...

The script is in the button "choose photo"

Code: Select all

on mouseUp
   lock screen
   iphonePickPhoto "library", 160,240
   if the result is "Cancel" then exit mouseUp
   set the text of image "imageholder" to the text of the last image of this card
   export image "imageholder" to URL("binfile:" & specialfolderpath("documents") & "/" & the seconds & ".png") as PNG
   delete the last image of this card
end mouseUp
be well

Dixie
Attachments
photolib.zip
(1.73 KiB) Downloaded 263 times

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: IOS PickPhoto

Post by Nakia » Tue Jun 05, 2012 10:10 pm

Thanks so much.

Am I then able to import this file into an image area?

kind of like below?

put URL ("binfile:" & specialfolderpath("documents") & "/" & filename & ".png") into "ImageArea"

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: IOS PickPhoto

Post by Dixie » Wed Jun 06, 2012 12:01 am

Hi...
Nakia wrote:Am I then able to import this file into an image area?
Use the following, where image x represents your 'image area'.

Code: Select all

set the filename of image x to specialfolderpath("documents") & slash & nameOfFile
be well,

Dixie

ludo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 72
Joined: Mon Dec 03, 2007 6:10 pm

Re: IOS PickPhoto

Post by ludo » Fri Jun 08, 2012 12:13 pm

Hello,

I've more questions about taking pictures with iOS.

How take "oriented" pictures ?

Thanks

Klaus
Posts: 14183
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: IOS PickPhoto

Post by Klaus » Fri Jun 08, 2012 2:01 pm

What the heck is an "oriented" picture? :shock:

But I doubt you can force the user to rotate by 90° degrees, if that is what you mean :D

ludo
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 72
Joined: Mon Dec 03, 2007 6:10 pm

Re: IOS PickPhoto

Post by ludo » Fri Jun 08, 2012 5:57 pm

Hello,

If i took a picture with the Apple App when my device is in "Portrait", the picture is displayed in Portrait in the album or the computer, but if i took a picture with livecode when the device is in portrait, my picture is in landscape.

Post Reply