Question

How can I display a photo form camera photos library in Windows phone?

  1. select a photo with PhotoChooserTask
  2. when I selected a photo I can display it inside an image box (it is easy)
  3. when I navigate to another page I pass the photo originalFileName and I try to display it on the second page too. It doesn't work

If I add some test photos to the solution I can display it, so the binding works. I think the photo path is wrong (\Applications\Data\F669605B-63B9-4FE9-8258-CD94B976577E\Data\PlatformData\PhotoChooser-2e4b2311-02b5-46b2-a259-37b4527e6117.jpg), but I don't know how can I get the right path. I don't want to create a copy in my application folder, I would like to use the photo from Media library.

Is it possible?

Was it helpful?

Solution

Due to a bug the PhotoChooserTask the PhotoResult.OriginalFileName returns a temporary path only.

from msdn: "... This property would be useful for retrieving the chosen photo from the XNA MediaLibrary so that you don't have to save it separately in isolated storage. However, as of this writing, the OriginalFileName implementation does not behave as expected: it returns a temporary filename that is not useful for retrieving the photo from the XNA MediaLibrary class later. However, ..."

Microsoft encourages you to store and load the image within your app. (example: see article about Saving and Loading Data)

sorry for bringing that message to you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top