save a collection of picture names to xml and display them at later time in wp7
I want to let the user add pictures from the picture libary or take picture on his own - I used PhotoChooserTask.
Then, I want to display a list with the pictures he chose, and also save this list of pictures to xml file (so i can show him the pictures he chose at later time).
- the problem is that the PhotoResult returns the stream of the picture (so I can display it, but can't save it in the xml for showing it later).
- I can also get the original file name (which is string and i can save it to the XML) but i'm no开发者_运维技巧t really sure how to find these pictures by the original file name and display them.
Thanks
I am not sure how you can find pictures from the gallery without the PhotoChooserTask and display them later but you can save the selected images in the phone's isolated storage and read them later.
Read and Save Images in Isolated Storage
However, I would like to point out that this would cause a possible duplication as a copy of the image will exist in your phone gallery as well in the application's isolated storage.
But if there is no other possible solution this, trick would do your job. I too will look forward if someone can suggest a better solution to this problem.
(It's not immediately clear what you're trying to do here - if you can be more specific in your question about your requirements you may get a better answer...)
Depending on what you need you'd probably be best in either:
- Saving the picture stream to your Isolated Storage so you have complete control of it (if you want to keep pictures local to your app and don't mind the duplication).
- Use the XNA
MediaLibrary
to explore the photos that the user has already taken. (see this blog post and MSDN).
It may be that a combination of PhotoChooserTask
and MediaLibrary
is the best, but that's difficult to say with the information posted so far.
精彩评论