Help Center

CGpGraphics.DrawRectanglesmethod

Draws a sequence of rectangles.

GraphicsmethodCGpGraphics.incdocumented

Syntax

FUNCTION DrawRectangles (BYVAL pPen AS CGpPen PTR, BYVAL rects AS GpRectF PTR, BYVAL count AS INT_) AS GpStatus
FUNCTION DrawRectangles (BYVAL pPen AS CGpPen PTR, BYVAL rects AS GpRect PTR, BYVAL count AS INT_) AS GpStatus

Parameters

NameDescription
pPenPointer to a pen that is used to draw the rectangles.
rectsPointer to an array of GpRectF or GpRect objects that specify the coordinates of the rectangles to be drawn.
countInteger that specifies the number of elements in the rects array.

Return value

If the function succeeds, it returns StatusOk, which is an element of the GpStatus enumeration.

If the function fails, it returns one of the other elements of the GpStatus enumeration.

Description

Draws a sequence of rectangles.

Example

' ======================================================================================== ' The following example draws a group of rectangles. ' ======================================================================================== SUB Example_DrawRectangles (BYVAL hdc AS HDC)

' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi

' // Create a pen object DIM blackPen AS CGpPen = CGpPen(ARGB_BLACK, 3)

' // Create an array of GpRect objects DIM rect1 AS GpRect = (0, 0, 100, 100) DIM rect2 AS GpRect = (100, 200, 250, 50) DIM rect3 AS GpRect = (300, 0, 50, 100) DIM rects(2) AS GpRect = {rect1, rect2, rect3}

' // Draw the rectangles graphics.DrawRectangles(@blackPen, @rects(0), 3)

END SUB ' ========================================================================================

Reference

  • Include file CGpGraphics.inc
  • Defined in AfxNova/CGpGraphics.inc:558
  • Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
  • Topic: CGpGraphics Class