Bitmap::Clone(REAL,REAL,REAL,REAL,PixelFormat) method (gdiplusheaders.h)

The Bitmap::Clone method creates a new Bitmap object by copying a portion of this bitmap.

Syntax

Bitmap * Clone(
  [in] REAL        x,
  [in] REAL        y,
  [in] REAL        width,
  [in] REAL        height,
  [in] PixelFormat format
);

Parameters

[in] x

Type: REAL

Real number that specifies the x-coordinate of the upper-left corner of the rectangle that specifies the portion of this bitmap to copy.

[in] y

Type: REAL

Real number that specifies the y-coordinate of the upper-left corner of the rectangle that specifies the portion of this bitmap to copy.

[in] width

Type: REAL

Real number that specifies the width of the rectangle that specifies the portion of this bitmap to copy.

[in] height

Type: REAL

Real number that specifies the height of the rectangle that specifies the portion of this image to copy.

[in] format

Type: PixelFormat

Integer that specifies the pixel format of the new bitmap. The PixelFormat data type and constants that represent various pixel formats are defined in Gdipluspixelformats.h. For more information about pixel format constants, see Image Pixel Format Constants.

Return value

Type: Bitmap*

This method returns a pointer to the new Bitmap object.

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusheaders.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Bitmap

Bitmap Constructors

Clone

Image

Image Pixel Format Constants

Images, Bitmaps, and Metafiles

Using Images, Bitmaps, and Metafiles