Class Drawer
Draw helper. This class is used to draw various chart primitives
Inheritance
Namespace: FastReport.BG.Styling
Assembly: FastReport.BG.dll
Syntax
public static class Drawer
Fields
breadCrumbArrowWidth
BreadCrumb Arrow Width.
Declaration
public static readonly int breadCrumbArrowWidth
Field Value
| Type | Description |
|---|---|
| System.Int32 |
breadCrumbSpacing
BreadCrumb Spacing.
Declaration
public static readonly int breadCrumbSpacing
Field Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
CreateDoughnutSectorPath(Single, Single, PointF, Single, Single)
Get GraphicsPath instance of Doughnut Sector figure built with 2 radiuses and angles
Declaration
public static GraphicsPath CreateDoughnutSectorPath(float aStart, float aSweep, PointF center, float rMin, float rMax)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | aStart | Start angle in degrees |
| System.Single | aSweep | Sweep angle in degrees |
| System.Drawing.PointF | center | Central point |
| System.Single | rMin | Minimal radius |
| System.Single | rMax | Maxmial radius |
Returns
| Type | Description |
|---|---|
| System.Drawing.Drawing2D.GraphicsPath | GraphicsPath of doughnut sector |
DrawBreadCrumb(Graphics, Rectangle, Style, String, Boolean, Boolean)
Draws bread Crumb
Declaration
public static void DrawBreadCrumb(Graphics g, Rectangle r, Style style, string text, bool cropLeft, bool cropRight)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | Graphics context |
| System.Drawing.Rectangle | r | Base rectangle |
| Style | style | Drawing style |
| System.String | text | Bread Crumb text |
| System.Boolean | cropLeft | Crop left side |
| System.Boolean | cropRight | Crop right side |
DrawDoughnutSectorText(Graphics, GraphicsPath, Style, StringFormat, TextArcDirection, String, Single, Single, PointF, Single, Single)
Draw text in doughnut sector
Declaration
public static void DrawDoughnutSectorText(Graphics g, GraphicsPath path, Style style, StringFormat sf, TextArcDirection txtDirection, string text, float aStart, float aSweep, PointF center, float rMin, float rMax)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | Graphics context |
| System.Drawing.Drawing2D.GraphicsPath | path | Path of sector |
| Style | style | Draw style |
| System.Drawing.StringFormat | sf | Text format |
| TextArcDirection | txtDirection | Text direction |
| System.String | text | Text to draw |
| System.Single | aStart | Start angle |
| System.Single | aSweep | Sweep angle |
| System.Drawing.PointF | center | Central point |
| System.Single | rMin | Minimal radius |
| System.Single | rMax | Maximal radius |
DrawRadialText(Graphics, RectangleF, Style, String, StringFormat)
Draws passed text on Graphics in circle with style and format
Declaration
public static void DrawRadialText(Graphics g, RectangleF rect, Style style, string text, StringFormat sf)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | Graphics context |
| System.Drawing.RectangleF | rect | Bounding rectangle |
| Style | style | Draw style |
| System.String | text | Text to draw |
| System.Drawing.StringFormat | sf | Text format |
DrawText(Graphics, GraphicsPath, Style, String, StringFormat)
Draws passed text on Graphics in path with style and format
Declaration
public static void DrawText(Graphics g, GraphicsPath path, Style style, string text, StringFormat sf)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | Graphics context |
| System.Drawing.Drawing2D.GraphicsPath | path | Bounding path |
| Style | style | Draw style |
| System.String | text | Text to draw |
| System.Drawing.StringFormat | sf | Text format |
DrawText(Graphics, PointF, SizeF, Style, String, StringFormat)
Draws passed text on Graphics at point with style and format
Declaration
public static void DrawText(Graphics g, PointF pt, SizeF sz, Style style, string text, StringFormat sf)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | Graphics context |
| System.Drawing.PointF | pt | Location to draw |
| System.Drawing.SizeF | sz | Bounding rectangle |
| Style | style | Draw style |
| System.String | text | Text to draw |
| System.Drawing.StringFormat | sf | Text format |
DrawText(Graphics, RectangleF, Style, String, StringFormat)
Draws passed text on Graphics in rectangle with style and format
Declaration
public static void DrawText(Graphics g, RectangleF r, Style style, string text, StringFormat sf)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | Graphics context |
| System.Drawing.RectangleF | r | Bounding rectangle |
| Style | style | Draw style |
| System.String | text | Text to draw |
| System.Drawing.StringFormat | sf | Text format |
GetArcPoint(PointF, Double, Single)
Get point on arc or circle
Declaration
public static PointF GetArcPoint(PointF center, double angleRad, float radius)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.PointF | center | Center of arc or circle |
| System.Double | angleRad | Angle in radians |
| System.Single | radius | Radius |
Returns
| Type | Description |
|---|---|
| System.Drawing.PointF | Return point in float coordinates |
GetBreadCrumbPath(Rectangle, Boolean, Boolean)
Get GraphicsPath instance of bread Crumb figure
Declaration
public static GraphicsPath GetBreadCrumbPath(Rectangle r, bool cropLeft, bool cropRight)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Rectangle | r | Base rectangle |
| System.Boolean | cropLeft | Crop left side |
| System.Boolean | cropRight | Crop right side |
Returns
| Type | Description |
|---|---|
| System.Drawing.Drawing2D.GraphicsPath | GraphicsPath of created figure |
GetChordLen(Double, Single)
Get length of chord in circle
Declaration
public static float GetChordLen(double angleRad, float radius)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | angleRad | Angle in radians |
| System.Single | radius | Radius |
Returns
| Type | Description |
|---|---|
| System.Single | Length of chord |
MeasureBreadCrumb(Style, String, Boolean, Boolean)
Measure bread Crumb size
Declaration
public static Size MeasureBreadCrumb(Style style, string text, bool cropLeft, bool cropRight)
Parameters
| Type | Name | Description |
|---|---|---|
| Style | style | Drawing style |
| System.String | text | Bread Crumb text |
| System.Boolean | cropLeft | Crop left side |
| System.Boolean | cropRight | Crop right side |
Returns
| Type | Description |
|---|---|
| System.Drawing.Size | Size of bread Crumb |