[]
        
(Showing Draft Content)

GrapeCity.Documents.Drawing.GcGraphics.DrawRectangle

DrawRectangle Method

DrawRectangle(RectangleF, Color, float, DashStyle)

Draws a rectangle using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the rectangle is drawn with a Pen having LineCap set to Square instead of Flat.

Declaration
public void DrawRectangle(RectangleF bounds, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)
Public Sub DrawRectangle(bounds As RectangleF, lineColor As Color, lineWidth As Single, Optional lineStyle As DashStyle = DashStyle.Solid)
Parameters
Type Name Description
RectangleF bounds

A RectangleF structure that represents the rectangle to draw.

Color lineColor

The color of lines used to draw the rectangle.

float lineWidth

The width of lines used to draw the rectangle.

DashStyle lineStyle

The style of lines used to draw the rectangle (solid by default).

DrawRectangle(RectangleF, Color, float, float[])

Draws a rectangle using a specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the rectangle is drawn with a Pen having LineCap set to Square instead of Flat.

Declaration
public void DrawRectangle(RectangleF bounds, Color lineColor, float lineWidth, float[] dashPattern)
Public Sub DrawRectangle(bounds As RectangleF, lineColor As Color, lineWidth As Single, dashPattern As Single())
Parameters
Type Name Description
RectangleF bounds

A RectangleF structure that represents the rectangle to draw.

Color lineColor

The color of lines used to draw the rectangle.

float lineWidth

The width of lines used to draw the rectangle.

float[] dashPattern

The dash pattern lines used to draw the rectangle.

DrawRectangle(RectangleF, Pen)

Draws a rectangle using a specified pen.

Declaration
public void DrawRectangle(RectangleF bounds, Pen pen)
Public Sub DrawRectangle(bounds As RectangleF, pen As Pen)
Parameters
Type Name Description
RectangleF bounds

A RectangleF structure that represents the rectangle to draw.

Pen pen

The pen used to draw the rectangle.