Loading from Photo Library into Browser instance

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Loading from Photo Library into Browser instance

Post by teacherguy » Sun Feb 19, 2012 8:00 pm

Can anyone tell me if it is possible (and if so, how) to choose a photo from the photo library and subsequently load it into a browser control rather than an image template? I have been unable to find any documentation on how to do this.

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

Re: Loading from Photo Library into Browser instance

Post by Jellicle » Sun Feb 19, 2012 9:49 pm

Just write the image to a file on the device and then open it in a browser. To write it to the device use the "export image to file filePathToImageFile" command (see the dictionary for details) and to show it in the browser use:

Code: Select all

 iPhoneControlSet browserID, "url", filePathToImageFile
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Loading from Photo Library into Browser instance

Post by teacherguy » Sun Feb 19, 2012 10:58 pm

Thanks Gerry, I'd been working at it since I posted and that's where I ended up (wow, maybe I'm learning from you folks!).

Next issue is: I'm trying to (post-pinch/zoom) export a snapshot of the image in the browser...so far it's coming up empty. Is it possible?

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Loading from Photo Library into Browser instance

Post by teacherguy » Sun Feb 19, 2012 11:12 pm

Something that I have learned: The browser rect is not a retina, even though all other dimensions I'm dealing with in my app are. Took me a while to figure that out, but now when exporting a snapshot from the browser will I be getting a half-sized image?

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: Loading from Photo Library into Browser instance

Post by teacherguy » Sun Feb 19, 2012 11:45 pm

Update: Indeed, while I needed to set a browser rec to non-retina dimensions, the snapshot export needed to be retina dimensions. Getting there!

Post Reply