Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Rect.Clone method

Applies to: desktop apps only

The Rect::Clone method creates a new Rect object and initializes it with the contents of this Rect object.

Syntax

Rect* Clone() const;

Parameters

This method has no parameters.

Return value

Type:

Type: Rect*

This method returns a pointer to the new Rect object.

Examples

The following example creates a Rect object, makes a copy of the Rect object, and draws a rectangle based on the copied Rect object.


VOID Example_Clone(HDC hdc    )
{
   Graphics graphics(hdc);

   // Create a Rect object, and copy it to a new rect object.
   Rect rect(50, 50, 200, 100);
   Rect* pRect = rect.Clone();

   // Draw a rectangle based on the copied Rect object.
   Pen pen(Color(255, 0, 0, 255));
   graphics.DrawRectangle(&pen, *pRect);
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplustypes.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Rect
RectF
Using a Pen to Draw Lines and Rectangles
Pens, Lines, and Rectangles

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

Show:
© 2014 Microsoft