I am trying to create a window for editing user rights, there is an Image control in this window
When I selected the image file, it will appear in this Image control and copy this file to the folder with images, the first time everything is fine, but the second time it shows an error
"The process cannot access the file" C: \ 1.jpg "because it is being used by another process."
I think this is because my Image Control uses this file, so I donβt know what I can do
private void Select_Click(object sender, RoutedEventArgs e) { OpenFileDialog od = new OpenFileDialog(); if (od.ShowDialog() == true) { string imageLocal = @"C:/1.jpg"; File.Copy(od.FileName, imageLocal, true); image1.Source = new BitmapImage(new Uri(imageLocal)); } }
c # file process image wpf
Lai32290 Aug 10 '13 at 23:27 2013-08-10 23:27
source share