日期:2014-05-18 浏览次数:20705 次
private void button1_Click(object sender, RoutedEventArgs e) { BitmapImage myBitmapImage = new BitmapImage(); myBitmapImage.BeginInit(); myBitmapImage.UriSource = new Uri(@"Images/Chrysanthemum.jpg", UriKind.Relative); myBitmapImage.EndInit(); image1.Source = myBitmapImage; }
private void button1_Click(object sender, RoutedEventArgs e) { BitmapImage myBitmapImage = new BitmapImage(); myBitmapImage.BeginInit(); myBitmapImage.UriSource = new Uri(@"Images/Chrysanthemum.jpg", UriKind.Relative); myBitmapImage.EndInit(); this.Title = myBitmapImage.Width.ToString(); image1.Source = myBitmapImage; }