Bitmap::Clone method

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

Syntax

Bitmap * Clone(
  IN INT         x,
  IN INT         y,
  IN INT         width,
  IN INT         height,
  IN PixelFormat format
);

Parameters

x

Type: INT

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

y

Type: INT

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

width

Type: INT

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

height

Type: INT

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

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: Type: Bitmap*

This method returns a pointer to the new Bitmapobject.

Requirements

   
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