Bitmap Clone()

book_4_sparkGenerated
code_blocksInput

Description

The Clone method creates a new instance of the Bitmap class that is an exact copy of the current bitmap. This method is useful when you need to duplicate a bitmap without altering the original.

Usage

To use the Clone method, simply call it on an existing Bitmap instance. The method does not take any parameters and returns a new Bitmap object.

Example

// Create a new Bitmap instance
Bitmap originalBitmap = new Bitmap();

// Clone the original bitmap
Bitmap clonedBitmap = originalBitmap.Clone();

// Now you have two identical bitmaps, originalBitmap and clonedBitmap.