XAML images sample

This sample demonstrates various techniques for displaying and manipulating images in your app using the Image control and the BitmapImage class.

4.9 Star
31,774 times
Add to favorites
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question

  • 555-555-0199@example.com
    1 Posts | Last post October 13, 2017
    • 555-555-0199@example.com
  • 555-555-0199@example.com
    1 Posts | Last post October 12, 2017
    • 555-555-0199@example.com
  • does it means the sample should be opened in 2017
    1 Posts | Last post June 28, 2017
    • Nice sample, but only one problem - VS2017 can't open this project type. Does it mean since 2013 this technology is obsolete and won't support by MS. and as result we should return to GDI+ ?
  • 可否增加代码运行效果图。
    3 Posts | Last post October 02, 2015
    • 如果能提供运行效果图,会提供下载的指导性作用! 谢谢!
    • Could you please post your question on English?
    • If you can offer the effect picture of operation,it were help us to know what you do and what it can help.
  • How to set image in image control on click of button
    2 Posts | Last post February 16, 2015
    • I have to set different image in image control each time on clicking a button so but I am not able to change it setting different source each time on click event.
    • Hi Blaze_9,
      My answer comes a little bit late, but I hope it helps someone. You have multiple chances to do the image change, here is my favorite.
      You can increment an integer at every click on the button. This integer represents the index in an array of ImageSource’s.
      ImageSource[] images = new ImageSource[]{ image1, image2, image 3, …}
      int i=0;
      private void button1_Click(object sender, RoutedEventArgs e){
          if(i>=images.Length) i=0;//reset the index
          myImageControl.Source = images[i];//set the image