Untitled

 avatar
unknown
plain_text
5 months ago
400 B
3
Indexable
private void MainImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    BitmapImage newImage = new BitmapImage();
    newImage.BeginInit();
    // Use an absolute path with correct escaping
    newImage.UriSource = new Uri(@"C:\Path\To\Your\image2.png", UriKind.Absolute);
    newImage.CacheOption = BitmapCacheOption.OnLoad;
    newImage.EndInit();
    MainImage.Source = newImage;
}
Editor is loading...
Leave a Comment