warning: beginner question
your example App accesses images in Assets. What should be the syntax in Thumbnail to access files in Picture library?
You would need to do this from either code behind or from a view model, you can't access the picture library from xaml.
Thank you fro your kick answer !! I guess that means that this is beyond my capabilities. Too bad that seemed like a nice control.
@pierresa It is possible. @ScottIsAFool was just saying that you need to load the images from the photos library from code, similar to how the sample loads the images from assets.
Shawn,
Thank you for clarification. In my app I can create this list of photos from the library. What I still do not see is how to pass a name from one of those files in Thumbnail field as this seem the only way to send info to the AdaptativeGridView control.
Rgds
Pierre
You cannot show images from the picture library just by passing the file name, due to sandboxing in UWP. You need to create an image source from the StorageFiles you have, then you can bind that to the image in XAML.
`This is how you could create a thumbnail image from a file:
var thumbnailStream = await file.GetScaledImageAsThumbnailAsync(ThumbnailMode.SingleItem, 200, ThumbnailOptions.UseCurrentScale);
var image = new BitmapImage();
await image.SetSourceAsync(thumbnailStream);
`
If you have a ViewModel with a property named "Thumbnail" and with type "BitmapImage" or "ImageSource", you could now assign the image to Thumbnail and then bind the XAML Image's Source to the Thumbnail property, similar to how it is done in the example code.
If you need general coding advice, like how to show images or thumbnails in UWP apps, or how data binding works in UWP, this is not the right place to ask. I'd recommend you to take a look at the UWP samples from Microsoft, there are examples showing how to load and show images. And maybe search StackOverflow or google for specific questions. This site is only there to report/ask things specific to toolkit controls. The AdaptiveGridView can show any content. Showing images in AdaptiveGridView is same as showing images in any other UWP control (ListView, FlipView, etc), so the question is not really specific to the control.
Thank you all, sorry for stupid question. I know understand.
Hi team,
I am really impressed with the convo went over here. I have one small question: I want to display all images from pictures library in my photo editing app. How can I do that in a fast way?
Basically, I want to create a gallery in my app which will show the images from Pictures library. As written above, we can't show the images directly from Pictures Library. So how can I do this?
@pierresa @ScottIsAFool @lukasf
Thanks.
@hellodear General UWP questions are best for StackOverflow or the MSDN forums.