Page 1 of 1
Saving/Opening Pictures
Posted: Wed Dec 07, 2011 2:43 pm
by jrarickGAec4d
I THINK I understand the nature of the "sandbox". But does that extend to the "Camera Roll"?
1) I need to be able to take a picture of a student/athlete and save it SOMEWHERE, keeping track of it's name and location.
2) I need to be able to open a card and display the student's picture.
Here are my questions:
A) Can I save a picture anywhere else but the camera roll? How? (And am I able to know the name of the picture that is saved?)
B) Once a picture is saved to a folder (and I have kept track of it's name and location), can I use the name of the picture and display it again on a different card? How?
Thank you all in advance.
Jack Rarick
Coach's Video Assistant
Re: Saving/Opening Pictures
Posted: Wed Dec 07, 2011 3:32 pm
by Mark
Hi Jack,
You can save a picture in the documents folder of your app. If you have some kind of a database in you app (this could be a simple text file even) then you can just store the file name with the student name/id.
One way to save a picture is to export an image object to a variable, e.g.
Kind regards,
Mark
Re: Saving/Opening Pictures
Posted: Fri Dec 09, 2011 5:31 pm
by tzenobite
hi, i have a similar question: if i make a stack as a sort of photo album, how i can let the user choose an image and copy it to the camera roll? i guess i have to use some ios command to do this
thanks in advance
Re: Saving/Opening Pictures
Posted: Fri Dec 09, 2011 6:49 pm
by bn
Hi tzenobite,
from the iOS Release Notes under the Help Menu:
Saving photos to the users album
You can save an image to the user's photo album by using:
iphoneExportImageToAlbum imageTextOrControl Where imageTextOrControl is one of:
• the binary data of an image (the 'text') in PNG, GIF or JPEG format
• a long id of an image object containing an image in PNG, GIF or JPEG format The command will return empty in the result if exporting succeeded. Otherwise it will return one
of:
• could not find image – the image object could not be found • not an image – the object was not an image • not a supported format – the image object in not of PNG, GIF or JPEG format • export failed – an error occurred while trying to save the image to the album
If the device has a camera, the image is saved to the Camera Roll, other wise it is saved to the Saved Photos album.
Note: When running in the simulator, there needs to be at least one image in the photo album for exporting to succeed. You can add images to the photo album in a simulator by dragging an image on the simulator window, and saving the image to album from Safari (click and hold on the image to bring up an alert with the option).
You may want to have a look at those iOS Release Notes.
Kind regards
Bernd
Re: Saving/Opening Pictures
Posted: Fri Dec 09, 2011 8:52 pm
by tzenobite
many thanks!