Page 1 of 1

Loading from Photo Library into Browser instance

Posted: Sun Feb 19, 2012 8:00 pm
by teacherguy
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.

Re: Loading from Photo Library into Browser instance

Posted: Sun Feb 19, 2012 9:49 pm
by Jellicle
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

Re: Loading from Photo Library into Browser instance

Posted: Sun Feb 19, 2012 10:58 pm
by teacherguy
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?

Re: Loading from Photo Library into Browser instance

Posted: Sun Feb 19, 2012 11:12 pm
by teacherguy
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?

Re: Loading from Photo Library into Browser instance

Posted: Sun Feb 19, 2012 11:45 pm
by teacherguy
Update: Indeed, while I needed to set a browser rec to non-retina dimensions, the snapshot export needed to be retina dimensions. Getting there!