GraphicsPath.AddRectangles(const RectF*, INT) method

Applies to: desktop apps only

The GraphicsPath::AddRectangles method adds a sequence of rectangles to this path.

Syntax

Status AddRectangles(
  [in]  const RectF *rects,
  [in]  INT count
);

Parameters

  • rects [in]
    Type: const RectF*

    Pointer to an array of rectangles that will be added to the path.

  • count [in]
    Type: INT

    Integer that specifies the number of elements in the rects array.

Return value

Type:

Type: Status****

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

Examples

The following example creates a GraphicsPath object path, adds two rectangles to path, and then draws path.

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

   RectF rects[] = {RectF(20.0f, 20.0f, 100.0f, 50.0f),
                    RectF(30.0f, 30.0f, 50.0f, 100.0f)};

   GraphicsPath path;
   path.AddRectangles(rects, 2);

   // Draw the path.
   Pen pen(Color(255, 255, 0, 0));
   graphics.DrawPath(&pen, &path);
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdipluspath.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

GraphicsPath

AddRectangle Methods

AddRectangles Methods

RectF

Clipping with a Region

Constructing and Drawing Paths

Creating a Path Gradient

Using a Pen to Draw Lines and Rectangles

Paths

Pens, Lines, and Rectangles

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012