Photo URI from image on device

Giffdev

New member
Oct 30, 2012
66
0
0
Hey everyone, I'm trying to develop my first Windows Phone 8 app, and I had a question that I can't find any answers to online:

for the time being, I'm trying to create a basic list that just displays thumbnails of photos the user has selected using the photo chooser in WP8 How to use the photo chooser task for Windows Phone

I'm able to display photo thumbnails if I use a URI from a website url, but I can't display an image when trying to get the file path from the device. Here's some of the basics (I have an object that essentially just has the uri string for an image source)

<ListBox Name="lstbox" Grid.Row="1" Margin="10, 10, 10, 10">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Height="80" Width="400">
<Image Source="{Binding ImageSource}" Width="80" Height="80"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</Listbox>

myImages.Add(new myImage(new Uri("http://www.google.com.au/logos/classicplus.png"))); <----- works fine, displays an image from a website

what does NOT work is doing something like this using the photo chooser:

void photoChooserTask_Completed(object sender, PhotoResult e)
{
if (e.TaskResult == TaskResult.OK)
{
myImages.Add(new myImage( new Uri(e.OriginalFileName)));
}
}


can someone please help me with this?
 
Is "myImage" (seen in the code above when you call the constructor "new myImage...") a class that you defined? If so, can you provide the code for the ImageSource property?
 

Members online

Forum statistics

Threads
339,329
Messages
2,262,348
Members
428,751
Latest member
JohnRichie