Table of Contents

Class DrawingArea

Namespace
PolarChart
Assembly
PolarChart.dll

This helper object is used to create drawings.

public class DrawingArea : IDisposable
Inheritance
DrawingArea
Implements
Inherited Members
Extension Methods

Fields

Brush

The type of Brush used for filling.

public Brush Brush

Field Value

Brush

Pen

The type of Pen used for lines.

public Pen Pen

Field Value

Pen

Properties

BackColor

Gets/sets the background color of the fillings.

public int BackColor { get; set; }

Property Value

int

Bitmap

The underlying bitmap that is drawn on.

public Bitmap Bitmap { get; }

Property Value

Bitmap

Clip

Gets/sets if clipping (not 'printing' pixels outside the set clipping area) is to be used or not.

public bool Clip { get; set; }

Property Value

bool

DrawStyle

Gets/sets the style of lines. Use one of: 0:Solid, 1:Dash, 2:Dot, 3:Dash-dot 4:Dash-dot-dot, 5:Custom

public int DrawStyle { get; set; }

Property Value

int

DrawWidth

Gets/sets the width of lines.

public float DrawWidth { get; set; }

Property Value

float

FillColor

Gets/sets the filling color of area's (ellipse, rectangle, polygon, etc.) as Windows color.

public int FillColor { get; set; }

Property Value

int

FillStyle

Gets/sets the FillStyle. Use -2:no fill, -1:solid fill, 0-52 HatchStyle

public int FillStyle { get; set; }

Property Value

int

Graphics

The underlying graphics object that is used.

public Graphics Graphics { get; }

Property Value

Graphics

Height

Gets the height of the image in pixels.

public int Height { get; }

Property Value

int

Left

Gets the left of the image (always 0)

public int Left { get; }

Property Value

int

LineColor

Gets/sets the color of the line as Windows color.

public int LineColor { get; set; }

Property Value

int

NormalYaxis

Gets/sets if the Y-axis is 'Normal' (bottom to top, like in a math chart) or top to bottom (like in images where (0,0) is the top-left corner, not the bottom-left).

public bool NormalYaxis { get; set; }

Property Value

bool

Rotated

Gets if the image is to be rotated.

public bool Rotated { get; }

Property Value

bool

ScaleHeight

Gets/sets the scaling height. This is a logical height which is mapped to the actual height.

public double ScaleHeight { get; set; }

Property Value

double

ScaleLeft

Gets/sets the logical scaling left value.

public double ScaleLeft { get; set; }

Property Value

double

ScaleTop

Gets/sets the logical scaling top value.

public double ScaleTop { get; set; }

Property Value

double

ScaleWidth

Gets/sets the scaling width. This is a logical width which is mapped to the actual width.

public double ScaleWidth { get; set; }

Property Value

double

ScaleX

Gets the multiplication factor from ScaleWidth to actual width.

public double ScaleX { get; }

Property Value

double

ScaleY

Gets the multiplication factor from ScaleHeight to actual height.

public double ScaleY { get; }

Property Value

double

Top

Gets the top of the image (always 0)

public int Top { get; }

Property Value

int

Width

Gets the width of the image in pixels.

public int Width { get; }

Property Value

int

Methods

AddPointToCurve(double, double)

Adds a point to a curve used to draw a curved line or polygon.

public void AddPointToCurve(double x, double y)

Parameters

x double
y double

AddText(PolarFont, double, double, string, bool, bool)

Adds a text to the drawing area.

public void AddText(PolarFont pFont, double x, double y, string pText, bool pSuppressSpacing = false, bool pSuppressRotating = false)

Parameters

pFont PolarFont

The Font specification to use.

x double

The X position to use.

y double

The Y position to use.

pText string

The text to print.

pSuppressSpacing bool

Pass as True to suppress spacing as defined in the font specification.

pSuppressRotating bool

Pass as True to suppress rotation as defined in the font specification.

CreateFont()

Gets a new Font object.

public PolarFont CreateFont()

Returns

PolarFont

Dispose()

Disposes the object and frees resources.

public void Dispose()

DrawCurve(int, object)

Draws a curve based on previously added CurvePoints (using AddPointToCurve).

public void DrawCurve(int pSmoothingFactor, object pColor = null)

Parameters

pSmoothingFactor int

The smoothing factor (0-3): 0: no smoothing (edgy); 3: max smoothing (curved)

pColor object

The Windows color to use for the curve.

DrawEllipse(double, double, double, double)

Draws an ellipse on the drawing area with the current pen and fill settings.

public void DrawEllipse(double x1, double y1, double X2, double Y2)

Parameters

x1 double
y1 double
X2 double
Y2 double

DrawLine(double, double, double, double, object)

Draws a line on the drawing area with the current pen.

public void DrawLine(double x1, double y1, double x2, double y2, object pLineColor = null)

Parameters

x1 double
y1 double
x2 double
y2 double
pLineColor object

The color of the line as Windows color.

DrawPolygon(object)

Draws a polygon based on previously added CurvePoints (using AddPointToCurve).

public void DrawPolygon(object pColor = null)

Parameters

pColor object

The Windows color to use for the curve.

DrawRect(double, double, double, double)

Draws a rectangle on the drawing area with the current pen and fill settings.

public void DrawRect(double x1, double y1, double X2, double Y2)

Parameters

x1 double
y1 double
X2 double
Y2 double

DrawRoundRect(double, double, double, double, double)

Draws a rounded rectangle on the drawing area with the current pen and fill settings.

public void DrawRoundRect(double x1, double y1, double x2, double y2, double Radius)

Parameters

x1 double
y1 double
x2 double
y2 double
Radius double

FontNames()

Returns a collection of strings containing all font names on the computer.

public Collection<string> FontNames()

Returns

Collection<string>

GetColor(object)

Gets a color from the specified pColor.

public static Color GetColor(object pColor)

Parameters

pColor object

A Color or Int value.

Returns

Color

A Color value.

RGB(byte, byte, byte)

Creates a windows color for the specified Red, Green and Blue values.

public static int RGB(byte pRed, byte pGreen, byte pBlue)

Parameters

pRed byte
pGreen byte
pBlue byte

Returns

int

RGB(int, int, int)

Creates a windows color for the specified Red, Green and Blue values.

public static int RGB(int pRed, int pGreen, int pBlue)

Parameters

pRed int
pGreen int
pBlue int

Returns

int

SetClippingArea(double, double, double, double)

Sets the clipping area (outside which no drawing takes place).

public void SetClippingArea(double x1, double y1, double X2, double Y2)

Parameters

x1 double
y1 double
X2 double
Y2 double

SetPixel(double, double)

Sets a pixel in the current color.

public void SetPixel(double x1, double y1)

Parameters

x1 double
y1 double

UnClip()

Cancels the clipping area.

public void UnClip()