WriteableBitmap originalBitmap = new WriteableBitmap(100, 100, 96, 96, PixelFormats.Pbgra32, null); // Code to modify the original bitmap... WriteableBitmap clonedBitmap = originalBitmap.Clone(); // Code to modify the cloned bitmap...
WriteableBitmap originalBitmap = new WriteableBitmap(new BitmapImage(new Uri("path/to/image.png", UriKind.Relative))); // Code to modify the original bitmap... WriteableBitmap clonedBitmap = originalBitmap.Clone(); // Code to modify the cloned bitmap...In this example, we create a new instance of the WriteableBitmap class from an existing BitmapImage object. We then modify the original bitmap and create a clone for further modification. Package library: System.Windows.Media.Imaging.