RectF.GetLocation method

Applies to: desktop apps only

The RectF::GetLocation method gets the coordinates of the upper-left corner of this rectangle.

Syntax

VOID GetLocation(
  [out]  PointF* point
) const;

Parameters

point [out]

Type: PointF*

Pointer to a PointF object that receives the coordinates of the upper-left corner of this rectangle.

Return value

This method does not return a value.

Examples

This example creates RectF object, gets the point of the upper-left corner of the rectangle, and then draws a rectangle and line from the upper-left corner to the point (0, 0).


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

   Pen pen(Color(255, 0, 0, 255));
   PointF location;
   RectF rect(50, 40, 200, 50);

   // Get the location of the upper-left corner of the rectangle.
   rect.GetLocation(&location);

   // Draw the rectangle.
   graphics.DrawRectangle(&pen, rect);

   // Draw a line from the upper-left corner of the rectangle to (0, 0).
   graphics.DrawLine(&pen, location, PointF(0, 0));
}

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

RectF
GetBottom
GetLeft
GetRight
GetTop
PointF
Rect
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

ADD
Show: