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.GetSize method

Applies to: desktop apps only

The Rect::GetSize method gets the width and height of the rectangle.

Syntax

VOID GetSize(
  [out]  Size* size
) const;

Parameters

size [out]

Type: Size*

Pointer to a Size object that receives the width and height of the rectangle.

Return value

This method does not return a value.

Examples

The following example creates a Rect object and gets the width and height of the rectangle.


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

   // Create a Rect object and a Size object.
   Size size;
   Rect rect(50, 40, 200, 100);

   // Get the size of the rectangle.
   rect.GetSize(&size);

   // Inspect or use the values in size.Width and size.Height.
}

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
Rect::GetBottom
Rect::GetLeft
Rect::GetRight
Rect::GetTop
RectF
Size
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:
© 2015 Microsoft