PickPhoto into database

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SteveHanlan
Posts: 80
Joined: Fri Jul 09, 2010 6:28 pm

PickPhoto into database

Post by SteveHanlan » Thu Jul 28, 2011 11:59 pm

If I use mobilePickPhoto "library" to get a pointer to an image in the iphone/ipad library (or indeed take a photo with the camera), how do I get to the actual image such that I can save, (a thumbnail of it), out to my documents folder?

I get as far as "the name of the last image" which yield the stack reference to it, but where is the actual image?

thanks

Steve

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: PickPhoto into database

Post by Jellicle » Fri Jul 29, 2011 2:48 am

Did you read the release notes? For the photo picker command, it says: "...a new image object will be created on the current card of the default stack..."

So the image is on the current card.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

SteveHanlan
Posts: 80
Joined: Fri Jul 09, 2010 6:28 pm

Re: PickPhoto into database

Post by SteveHanlan » Fri Jul 29, 2011 3:01 am

Yes I did!

But, I don't get how to save that image out to a file in the 'documents' folder.

Steve

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: PickPhoto into database

Post by Jellicle » Fri Jul 29, 2011 3:31 am

SteveHanlan wrote:I don't get how to save that image out to a file in the 'documents' folder.
This works on the desktop - I think it'll work on iOS:

Code: Select all

set the defaultFolder to specialFolderPath("Documents")
put image "test" into URL (("binfile:"&test&".jpg"))
Just substitute whatever your image name or id is, and whatever you want to call the file.

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

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

Re: PickPhoto into database

Post by Klaus » Fri Jul 29, 2011 11:36 am

Hi guys,

I heard that some user have problems setting the default folder on iOS.
So it is a better idea to supply the complete filepath:
...
put image "test" into URL ("binfile:" & specialfolderpath("documents") & "/name of image here.jpg")
...

Best

Klaus

SteveHanlan
Posts: 80
Joined: Fri Jul 09, 2010 6:28 pm

Re: PickPhoto into database

Post by SteveHanlan » Fri Jul 29, 2011 4:50 pm

Gerry - That worked. It was the 'binfile' that I missed - Doh!

Klaus - Good advice

Thanks to all
Steve

Post Reply