public static void ShowImage(string filepath) { if (!string.IsNullOrEmpty(filepath) && File.Exists(filepath)) { using (Image img = ImageHelpers.LoadImage(filepath)) using (ImageViewer viewer = new ImageViewer(img)) { viewer.ShowDialog(); } } }
public static void ShowImage(Image img) { if (img != null) { using (Image tempImage = (Image)img.Clone()) using (ImageViewer viewer = new ImageViewer(tempImage)) { viewer.ShowDialog(); } } }