开发者

WPF how users add images

开发者 https://www.devze.com 2023-01-21 12:34 出处:网络
What is the best way to allow a user to insert photos for an image viewer? The end result I am looking for would be thumbnails in a listbox that when selected would open in a viewbox. I understand the

What is the best way to allow a user to insert photos for an image viewer? The end result I am looking for would be thumbnails in a listbox that when selected would open in a viewbox. I understand the binding开发者_如何学Python, but I don't know how to get the photos to a folder or whatever from the user.


It's not very clear from your question, but if you want the user to select a photo on their disk and then show it, use the OpenFileDialog to choose the file and then use Image with Source set to a BitmapSource with UriSource set to the filename of the selected image (as shown in the Examples section of docuementation for Image).

0

精彩评论

暂无评论...
验证码 换一张
取 消