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
Pen
The type of Pen used for lines.
public Pen Pen
Field Value
Properties
BackColor
Gets/sets the background color of the fillings.
public int BackColor { get; set; }
Property Value
Bitmap
The underlying bitmap that is drawn on.
public Bitmap Bitmap { get; }
Property Value
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
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
DrawWidth
Gets/sets the width of lines.
public float DrawWidth { get; set; }
Property Value
FillColor
Gets/sets the filling color of area's (ellipse, rectangle, polygon, etc.) as Windows color.
public int FillColor { get; set; }
Property Value
FillStyle
Gets/sets the FillStyle. Use -2:no fill, -1:solid fill, 0-52 HatchStyle
public int FillStyle { get; set; }
Property Value
Graphics
The underlying graphics object that is used.
public Graphics Graphics { get; }
Property Value
Height
Gets the height of the image in pixels.
public int Height { get; }
Property Value
Left
Gets the left of the image (always 0)
public int Left { get; }
Property Value
LineColor
Gets/sets the color of the line as Windows color.
public int LineColor { get; set; }
Property Value
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
Rotated
Gets if the image is to be rotated.
public bool Rotated { get; }
Property Value
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
ScaleLeft
Gets/sets the logical scaling left value.
public double ScaleLeft { get; set; }
Property Value
ScaleTop
Gets/sets the logical scaling top value.
public double ScaleTop { get; set; }
Property Value
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
ScaleX
Gets the multiplication factor from ScaleWidth to actual width.
public double ScaleX { get; }
Property Value
ScaleY
Gets the multiplication factor from ScaleHeight to actual height.
public double ScaleY { get; }
Property Value
Top
Gets the top of the image (always 0)
public int Top { get; }
Property Value
Width
Gets the width of the image in pixels.
public int Width { get; }
Property Value
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
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
PolarFontThe Font specification to use.
x
doubleThe X position to use.
y
doubleThe Y position to use.
pText
stringThe text to print.
pSuppressSpacing
boolPass as True to suppress spacing as defined in the font specification.
pSuppressRotating
boolPass as True to suppress rotation as defined in the font specification.
CreateFont()
Gets a new Font object.
public PolarFont CreateFont()
Returns
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
intThe smoothing factor (0-3): 0: no smoothing (edgy); 3: max smoothing (curved)
pColor
objectThe 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
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
DrawPolygon(object)
Draws a polygon based on previously added CurvePoints (using AddPointToCurve).
public void DrawPolygon(object pColor = null)
Parameters
pColor
objectThe 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
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
FontNames()
Returns a collection of strings containing all font names on the computer.
public Collection<string> FontNames()
Returns
GetColor(object)
Gets a color from the specified pColor.
public static Color GetColor(object pColor)
Parameters
pColor
objectA 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
Returns
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
Returns
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
SetPixel(double, double)
Sets a pixel in the current color.
public void SetPixel(double x1, double y1)
Parameters
UnClip()
Cancels the clipping area.
public void UnClip()