Graphics.DrawRectangle Method (Pen, RectangleF)

Draws a rectangle specified by a RectangleF structure.

Namespace: Aurigma.GraphicsMill.AdvancedDrawing
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void DrawRectangle(
	Pen pen,
	RectangleF rectangle
)

Parameters

pen

Type: Aurigma.GraphicsMill.AdvancedDrawing.Pen

A Pen that determines the color, width, and style of the rectangle.
rectangle

Type: System.Drawing.RectangleF

Remarks

To fill a rectangle, use FillRectangle(Brush, RectangleF) method.

Examples

C#
using (var bitmap = new Bitmap(80, 80, PixelFormat.Format24bppRgb, RgbColor.White))
using (var graphics = bitmap.GetAdvancedGraphics())
{
    graphics.DrawRectangle(new Pen(RgbColor.Blue), new System.Drawing.Rectangle(10, 10, 60, 60));
    bitmap.Save(@"Images\Output\out.png");
}

See Also

Reference

Manual