GraphicsExtensionMethods

public static class GraphicsExtensionMethods
Provides extension methods for the Eto graphics object.

Fields

StandardRuleLine

#
public static readonly Color StandardRuleLine

StandardRuleMargin

#
public static readonly Color StandardRuleMargin

Methods

AddNoise

#Example
public static void AddNoise(this Context context, NoiseFlavour flavour, float strength)
Add noise to an entire control.
context (Context)Graphics context.
flavour (NoiseFlavour)Flavour of noise.
strength (float)Strength of noise in the (0, 1) range.

AddNoise

#Example
public static void AddNoise(this Graphics graphics, NoiseFlavour flavour, float strength, CircleF region)
Fill a region with noise.
graphics (Graphics)Graphics object to draw with.
flavour (NoiseFlavour)Flavour of noise.
strength (float)Strength of noise in the (0, 1) range.
region (CircleF)Region to fill.

AddNoise

#Example
public static void AddNoise(this Graphics graphics, NoiseFlavour flavour, float strength, GraphicsPath region)
Fill a region with noise.
graphics (Graphics)Graphics object to draw with.
flavour (NoiseFlavour)Flavour of noise.
strength (float)Strength of noise in the (0, 1) range.
region (GraphicsPath)Region to fill.

AddNoise

#Example
public static void AddNoise(this Graphics graphics, NoiseFlavour flavour, float strength, RectangleF region)
Fill a region with noise.
graphics (Graphics)Graphics object to draw with.
flavour (NoiseFlavour)Flavour of noise.
strength (float)Strength of noise in the (0, 1) range.
region (RectangleF)Region to fill.
public static void Clear(this Graphics graphics)
Clear the graphics using black-based transparent.
graphics (Graphics)

DrawAnchoredText

#Example
public static RectangleF DrawAnchoredText(this Graphics graphics, Font font, Color colour, string text, TextAnchor anchor, PointF point)
Draw text whose anchor is at a specific location.
graphics (Graphics)Graphics object to draw with.
font (Font)Font to use.
colour (Color)Colour of text.
text (string)Text.
anchor (TextAnchor)Anchor point.
point (PointF)Location.

DrawAngledText

#Example
public static void DrawAngledText(this Graphics graphics, Font font, Color colour, string text, PointF point, SizeF direction)
Draw text at a point along a direction. This method automatically aligns and rotates text to keep it as upright as possible.
graphics (Graphics)Graphics object to draw with.
font (Font)Font to use.
colour (Color)Colour of text.
text (string)Text.
point (PointF)Location.
direction (SizeF)Text base line vector.

DrawAngledText

#Example
public static void DrawAngledText(this Graphics graphics, Font font, Color colour, string text, TextAnchor anchor, PointF point, float angle)
Draw rotated text.
graphics (Graphics)Graphics object to draw with.
font (Font)Font to use.
colour (Color)Colour of text.
text (string)Text.
anchor (TextAnchor)Anchor point.
point (PointF)Location.
angle (float)Rotation angle.

DrawArc

#Example
public static void DrawArc(this Graphics graphics, Color colour, float width, ArcF arc)
Draw an arc.
graphics (Graphics)Graphics object to draw with.
colour (Color)Edge colour.
width (float)Edge thickness
arc (ArcF)Arc.

DrawArc

#Example
public static void DrawArc(this Graphics graphics, Pen pen, ArcF arc)
Draw an arc.
graphics (Graphics)Graphics object to draw with.
pen (Pen)Edge edge.
arc (ArcF)Arc.

DrawArrow

#Example
public static void DrawArrow(this Graphics graphics, Color colour, float width, LineF line, float size)
Draw an arrow.
graphics (Graphics)Graphics object.
colour (Color)Colour of arrow.
width (float)Width of arrow line
line (LineF)Arrow shaft.
size (float)Size of arrowhead in pixels.

DrawArrow

#Example
public static void DrawArrow(this Graphics graphics, Pen pen, LineF line, float size)
Draw an arrow.
graphics (Graphics)Graphics object.
pen (Pen)Pen for arrow shape.
line (LineF)Arrow shaft.
size (float)Size of arrowhead in pixels.

DrawArrowBi

#Example
public static void DrawArrowBi(this Graphics graphics, Pen pen, LineF line, float size)
Draw an arrow at both ends of a line segment.
graphics (Graphics)Graphics object.
pen (Pen)Pen for arrow shape.
line (LineF)Arrow shaft.
size (float)Size of arrowhead in pixels.

DrawArrowDimples

#Example
public static void DrawArrowDimples(this Graphics graphics, PointF centre, int direction)
Draw a set of three dimples hinting at a draggable area.
graphics (Graphics)Graphics object to draw with.
centre (PointF)Centre coordinate of dimples.
direction (int)Arrow direction (0=up, 1=down, s=left, 3=right)

DrawBalloonLabel

#Example
public static void DrawBalloonLabel(this Graphics graphics, PointF tip, string text, Font font = null, Shade shade = null, SizeF? size = null, float scale = 1)
Draw a balloon with a text label.
graphics (Graphics)Graphics object to draw with.
tip (PointF)Balloon tip.
text (string)Text to draw.
font (Font = null)Font to use.
shade (Shade = null)Balloon shading.
size (SizeF? = null)Size override, handy for keeping consecutive balloon drawings the same size while the content changes.
scale (float = 1)Scaling factor for entire shape.

DrawBalloonLabel

#Example
public static void DrawBalloonLabel(this Graphics graphics, PointF tip, string text, Font font, Color colour)
graphics (Graphics)
tip (PointF)
text (string)
font (Font)
colour (Color)

DrawBarDimples

#Example
public static void DrawBarDimples(this Graphics graphics, PointF centre, bool vertical)
Draw a set of five dimples hinting at a draggable area.
graphics (Graphics)Graphics object to draw with.
centre (PointF)Centre coordinate of dimples.
vertical (bool)If true, the dimples will be ordered in two columns. If false, two rows.

DrawBezier

#Example
public static void DrawBezier(this Graphics graphics, Pen pen, BezierF bezier)
Draw a bezier segment.
graphics (Graphics)Graphics object to draw with.
pen (Pen)Edge edge.
bezier (BezierF)Bezier segment.

DrawBox

#Example
public static void DrawBox(this Graphics graphics, BoxFAxo box, Pen edges)
Draw the edges of a box.
graphics (Graphics)Graphics object to draw with.
box (BoxFAxo)Box to draw.
edges (Pen)Pen for all edges.

DrawBox

#Example
public static void DrawBox(this Graphics graphics, BoxFAxo box, Pen silhouette, Pen interior, Pen hidden)
Draw the edges of a box.
graphics (Graphics)Graphics object to draw with.
box (BoxFAxo)Box to draw.
silhouette (Pen)Optional edge for box outline.
interior (Pen)Optional edge for interior visible edges.
hidden (Pen)Optional edge for hidden edges.

DrawBox

#Example
public static void DrawBox(this Graphics graphics, BoxFAxo box, Pen visible, Pen hidden)
Draw the edges of a box.
graphics (Graphics)Graphics object to draw with.
box (BoxFAxo)Box to draw.
visible (Pen)Optional edge for visible edges.
hidden (Pen)Optional edge for hidden edges.

DrawBracketLabel

#Example
public static void DrawBracketLabel(this Graphics graphics, Font font, Color colour, PointF left, PointF right, string text)
Draw a bracketed label underneath some anchor points.
graphics (Graphics)Graphic object.
font (Font)Font to use.
colour (Color)Colour of text and bracket.
left (PointF)Anchor point for left edge of bracket.
right (PointF)Anchor point for right edge of bracket.
text (string)Label text.

DrawCenteredText

#Example
public static void DrawCenteredText(this Graphics graphics, PointF centre, Font font, Brush fill, string text)
Draw centered text.
graphics (Graphics)Graphics objects to draw with.
centre (PointF)Centre point.
font (Font)Font to draw with.
fill (Brush)Text fill.
text (string)Text to draw.

DrawCenteredText

#Example
public static void DrawCenteredText(this Graphics graphics, PointF centre, Font font, Color colour, string text)
Draw centered text.
graphics (Graphics)Graphics objects to draw with.
centre (PointF)Centre point.
font (Font)Font to draw with.
colour (Color)Text colour.
text (string)Text to draw.

DrawCircle

#Example
public static void DrawCircle(this Graphics graphics, Color colour, float width, CircleF circle)
Draw a circle.
graphics (Graphics)Graphics object to draw with.
colour (Color)Edge colour.
width (float)Edge thickness
circle (CircleF)Circle.

DrawCircle

#Example
public static void DrawCircle(this Graphics graphics, Pen pen, CircleF circle)
Draw a circle.
graphics (Graphics)Graphics object to draw with.
pen (Pen)Edge edge.
circle (CircleF)Circle.

DrawColourPivot

#Example
public static void DrawColourPivot(this Graphics graphics, Color colour, PointF point, float radius)
Draw the standard pivot shape at the given location.
graphics (Graphics)Graphics object to draw with.
colour (Color)Pivot colour.
point (PointF)Pivot location.
radius (float)Pivot radius.

DrawCornerShadow

#Example
public static void DrawCornerShadow(this Graphics graphics, PointF point, ShadowCorner corner, ShadowSize size = ShadowSize.Medium)
Draw a quarter-circle shadow radiating outward from a single point, darkest at the point and fading with radial distance. Use this to round off the corners where two DrawEdgeShadow strips meet. The pixel radius and peak opacity match the straight edges of the same ShadowSize.
graphics (Graphics)Graphics object to draw with.
point (PointF)Point the shadow radiates from (the rectangle corner).
corner (ShadowCorner)Which corner this is, i.e. the quadrant the shadow fans into.
size (ShadowSize = ShadowSize.Medium)Preset shadow size.

DrawCornerShadow

#Example
public static void DrawCornerShadow(this Graphics graphics, PointF point, ShadowCorner corner, ShadowSize size, float opacity)
Draw a quarter-circle shadow as DrawCornerShadow(Graphics, PointF, ShadowCorner, ShadowSize), but faded to the given opacity.
graphics (Graphics)Graphics object to draw with.
point (PointF)Point the shadow radiates from (the rectangle corner).
corner (ShadowCorner)Which corner this is, i.e. the quadrant the shadow fans into.
size (ShadowSize)Preset shadow size.
opacity (float)Opacity multiplier (0.0 ~ 1.0) applied to the whole shadow.

DrawCylinder

#Example
public static void DrawCylinder(this Graphics graphics, CylinderFAxo cylinder, Pen edges)
Draw the wireframe of a cylinder.
graphics (Graphics)Graphics object to draw with.
cylinder (CylinderFAxo)Cylinder to draw.
edges (Pen)Pen for the edges.

DrawCylinder

#Example
public static void DrawCylinder(this Graphics graphics, CylinderFAxo cylinder, Pen silhouette, Pen interior, Pen hidden, bool fromAbove)
Draw the wireframe of a cylinder.
graphics (Graphics)Graphics object to draw with.
cylinder (CylinderFAxo)Cylinder to draw.
silhouette (Pen)Optional edge for outline edges.
interior (Pen)Optional edge for outline edges.
hidden (Pen)Optional edge for hidden edges.
fromAbove (bool)If true, the top face of the cylinder is assumed to face the viewer.

DrawCylinder

#Example
public static void DrawCylinder(this Graphics graphics, CylinderFAxo cylinder, Pen visible, Pen hidden, bool fromAbove)
Draw the wireframe of a cylinder.
graphics (Graphics)Graphics object to draw with.
cylinder (CylinderFAxo)Cylinder to draw.
visible (Pen)Pen for visible edges.
hidden (Pen)Optional edge for hidden edges.
fromAbove (bool)If true, the top face of the cylinder is assumed to face the viewer.

DrawDebugBox

#Example
public static void DrawDebugBox(this Graphics graphics, RectangleF box, Color colour)
Draw a dotted debug box handy while writing layout code.
graphics (Graphics)
box (RectangleF)
colour (Color)

DrawDimples

#Example
public static void DrawDimples(this Graphics graphics, PointF centre, params (int dx, int dy)[] dimples)
Draw a set of dimples hinting at a draggable area.
graphics (Graphics)Graphics object to draw with.
centre (PointF)Centre coordinate of dimples.
dimples (params (int dx, int dy)[])Array of dimple offsets with respect to the centre point.

DrawDisabledMotif

#Example
public static void DrawDisabledMotif(this Graphics graphics, Control control)
Draw a standard disabled control motif.
graphics (Graphics)
control (Control)

DrawDisabledMotif

#Example
public static void DrawDisabledMotif(this Graphics graphics, RectangleF bounds)
Draw a standard disabled control motif.
graphics (Graphics)
bounds (RectangleF)

DrawEllipse

#Example
public static void DrawEllipse(this Graphics graphics, Color colour, float width, EllipseF ellipse)
Draw an ellipse.
graphics (Graphics)Graphics object to draw with.
colour (Color)Edge colour.
width (float)Edge thickness
ellipse (EllipseF)Ellipse.

DrawEllipse

#Example
public static void DrawEllipse(this Graphics graphics, Pen pen, EllipseF ellipse)
Draw an ellipse.
graphics (Graphics)Graphics object to draw with.
pen (Pen)Edge edge.
ellipse (EllipseF)Ellipse.

DrawFadingArc

#Example
public static void DrawFadingArc(this Graphics graphics, Color colour, ArcF arc, float width)
Draw an arc which fades to transparency at both ends.
graphics (Graphics)Graphics object to draw with.
colour (Color)Colour in middle of line.
arc (ArcF)Arc to draw.
width (float)Thickness of line.

DrawFadingArc

#Example
public static void DrawFadingArc(this Graphics graphics, Color colour, Color colourTip, ArcF arc, float width)
Draw an arc which fades to a different colour at both ends.
graphics (Graphics)Graphics object to draw with.
colour (Color)Colour in middle of arc.
colourTip (Color)Colour at extreme of arc.
arc (ArcF)Arc to draw.
width (float)Thickness of arc.

DrawFadingColour

#Example
public static void DrawFadingColour(this Graphics graphics, Color colour, RectangleF box, float width0, float width1)
Draw a vertical block with fade-in and fade-out regions.
graphics (Graphics)Graphics object
colour (Color)Colour for block.
box (RectangleF)Rectangle with solid colour.
width0 (float)Width of left fading region.
width1 (float)Wdth of right fading region.

DrawFadingLine

#Example
public static void DrawFadingLine(this Graphics graphics, Color colour, Color colourTip, PointF p0, PointF p1, float width)
Draw a line which fades to another colour at both ends.
graphics (Graphics)Graphics object to draw with.
colour (Color)Colour in middle of line.
colourTip (Color)Colour at line extremes.
p0 (PointF)Start point of line.
p1 (PointF)End point of line.
width (float)Thickness of line.

DrawFadingLine

#Example
public static void DrawFadingLine(this Graphics graphics, Color colour, PointF p0, PointF p1, float width)
Draw a line which fades to transparency at both ends.
graphics (Graphics)Graphics object to draw with.
colour (Color)Colour in middle of line.
p0 (PointF)Start point of line.
p1 (PointF)End point of line.
width (float)Thickness of line.

DrawFrame

#Example
public static void DrawFrame(this Graphics graphics, Rectangle rectangle, Color colour, string text, Font font, int width, int radius)
Draw a frame with a title.
graphics (Graphics)Graphics object to draw with.
rectangle (Rectangle)Frame rectangle.
colour (Color)Frame and text colour.
text (string)Frame text.
font (Font)Text font.
width (int)Frame thickness.
radius (int)Radius of corners.

DrawFrame

#Example
public static void DrawFrame(this Graphics graphics, Rectangle rectangle, Color colour, string text, int width, int radius)
Draw a frame with a title.
graphics (Graphics)Graphics object to draw with.
rectangle (Rectangle)Frame rectangle.
colour (Color)Frame and text colour.
text (string)Frame text.
width (int)Frame thickness.
radius (int)Radius of corners.

DrawFrame

#Example
public static void DrawFrame(this Graphics graphics, Rectangle rectangle, Color colour, string text, int width)
Draw a frame with a title.
graphics (Graphics)Graphics object to draw with.
rectangle (Rectangle)Frame rectangle.
colour (Color)Frame and text colour.
text (string)Frame text.
width (int)Frame thickness.

DrawFrame

#Example
public static void DrawFrame(this Graphics graphics, Rectangle rectangle, Color colour, string text)
Draw a frame with a title.
graphics (Graphics)Graphics object to draw with.
rectangle (Rectangle)Frame rectangle.
colour (Color)Frame and text colour.
text (string)Frame text.

DrawFunction

#Example
public static void DrawFunction(this Graphics graphics, Pen edge, FrameF frame, Function function, int samples)
Draw a function within a frame.
graphics (Graphics)Graphics object to draw with.
edge (Pen)Pen for function.
frame (FrameF)Projection frame.
function (Function)Function to draw.
samples (int)Sample count hint.

DrawImageWithPadding

#Example
public static void DrawImageWithPadding(this Graphics graphics, Image image, float opacity, CircleF circle, int padding)
Draw an image into a circle.
graphics (Graphics)Graphics object to draw with.
image (Image)Image to draw.
opacity (float)Opacity of image fill.
circle (CircleF)Target circle for image.
padding (int)Number of image pixels to put outside the rectangle edges.

DrawImageWithPadding

#Example
public static void DrawImageWithPadding(this Graphics graphics, Image image, float opacity, RectangleF rectangle, int padding)
Draw an image into a rectangle.
graphics (Graphics)Graphics object to draw with.
image (Image)Image to draw.
opacity (float)Opacity of image fill.
rectangle (RectangleF)Target rectangle for image.
padding (int)Number of image pixels to put outside the rectangle edges.

DrawInsideShadow

#Example
public static void DrawInsideShadow(this Graphics graphics, RectangleF area, ShadowEdge edges, ShadowSize size = ShadowSize.Medium)
Draw an inset shadow inside a rectangle, darkest along the specified edge(s) and fading toward the rectangle's interior. The pixel width and peak opacity for each preset are defined in ShadowPixelSize(ShadowSize) and ShadowPixelAlpha(ShadowSize).
graphics (Graphics)Graphics object to draw with.
area (RectangleF)Rectangle to draw the shadow inside.
edges (ShadowEdge)Which edge(s) of area are darkest. Combine with bitwise OR.
size (ShadowSize = ShadowSize.Medium)Preset shadow size.

DrawInsideShadow

#Example
public static void DrawInsideShadow(this Graphics graphics, RectangleF area, ShadowEdge edges, ShadowSize size, float opacity)
Draw an inset shadow as DrawInsideShadow(Graphics, RectangleF, ShadowEdge, ShadowSize), but faded to the given opacity.
graphics (Graphics)Graphics object to draw with.
area (RectangleF)Rectangle to draw the shadow inside.
edges (ShadowEdge)Which edge(s) of area are darkest. Combine with bitwise OR.
size (ShadowSize)Preset shadow size.
opacity (float)Opacity multiplier (0.0 ~ 1.0) applied to the whole shadow.

DrawKeyValueList

#Example
public static void DrawKeyValueList(this Graphics graphics, RectangleF frame, Font fontKey, Font fontValue, Color colourKey, Color colourValue, IEnumerable<StringKeyValueItem> items)
Draw a list of key-value items.
graphics (Graphics)Graphics object.
frame (RectangleF)Frame for items.
fontKey (Font)Font to use for drawing keys.
fontValue (Font)Font to use for drawing values.
colourKey (Color)Colour of keys.
colourValue (Color)Colour of values.
items (IEnumerable<StringKeyValueItem>)Collection of items.

DrawLine

#Example
public static void DrawLine(this Graphics graphics, Color colour, float width, LineF line)
Draw a line.
graphics (Graphics)Graphics object to draw with.
colour (Color)Edge colour.
width (float)Edge thickness
line (LineF)Line.

DrawLine

#Example
public static void DrawLine(this Graphics graphics, Pen pen, LineF line)
Draw a line.
graphics (Graphics)Graphics object to draw with.
pen (Pen)Edge edge.
line (LineF)Line.

DrawLineThroughBox

#Example
public static void DrawLineThroughBox(this Graphics graphics, Rectangle box, Color colour, Point point0, Point point1)
Draw a line through a box.
graphics (Graphics)Graphics object to draw with.
box (Rectangle)Box to include.
colour (Color)Colour of line.
point0 (Point)First point on line.
point1 (Point)Second point on line.

DrawLineThroughBox

#Example
public static void DrawLineThroughBox(this Graphics graphics, Rectangle box, Pen pen, Point point0, Point point1)
Draw a line through a box.
graphics (Graphics)Graphics object to draw with.
box (Rectangle)Box to include.
pen (Pen)Pen of line.
point0 (Point)First point on line.
point1 (Point)Second point on line.

DrawLineThroughBox

#Example
public static void DrawLineThroughBox(this Graphics graphics, RectangleF box, Color colour, PointF point0, PointF point1)
Draw a line through a box.
graphics (Graphics)Graphics object to draw with.
box (RectangleF)Box to include.
colour (Color)Colour of line.
point0 (PointF)First point on line.
point1 (PointF)Second point on line.

DrawLineThroughBox

#Example
public static void DrawLineThroughBox(this Graphics graphics, RectangleF box, Pen pen, PointF point0, PointF point1)
Draw a line through a box.
graphics (Graphics)Graphics object to draw with.
box (RectangleF)Box to include.
pen (Pen)Pen of line.
point0 (PointF)First point on line.
point1 (PointF)Second point on line.

DrawMarker

#Example
public static void DrawMarker(this Graphics graphics, Family colour, RectangleF target, RectangleF framing)
Draw a circle and arrow around a target box.
graphics (Graphics)Graphics object. Ideally this is 1:1 screen scaling, i.e. control graphics.
colour (OpenColor.Family)Colour of marker shapes.
target (RectangleF)Target of marker.
framing (RectangleF)Frame bounds. This controls where the pointing arrow is located. Provide the target rectangle again to prevent arrows from being drawn.

DrawMatrix

#Example
public static void DrawMatrix(this Graphics graphics, Font font, Color colour, RectangleF frame, double[][] matrix, string format)
Draw a matrix within a rectangle.
graphics (Graphics)Graphics object to draw with.
font (Font)Font to draw with.
colour (Color)Colour of matrix text and brackets.
frame (RectangleF)Rectangular frame.
matrix (double[][])Matrix to draw.
format (string)Formatting pattern for matrix values.

DrawMatrix

#Example
public static void DrawMatrix(this Graphics graphics, Font font, Color colour, RectangleF frame, double[][] matrix)
Draw a matrix within a rectangle.
graphics (Graphics)Graphics object to draw with.
font (Font)Font to draw with.
colour (Color)Colour of matrix text and brackets.
frame (RectangleF)Rectangular frame.
matrix (double[][])Matrix to draw,

DrawMatrix

#Example
public static void DrawMatrix(this Graphics graphics, Font font, Color colour, RectangleF frame, int[][] matrix)
Draw a matrix within a rectangle.
graphics (Graphics)Graphics object to draw with.
font (Font)Font to draw with.
colour (Color)Colour of matrix text and brackets.
frame (RectangleF)Rectangular frame.
matrix (int[][])Matrix to draw,

DrawMatrix

#Example
public static void DrawMatrix(this Graphics graphics, Font font, Color colour, RectangleF frame, string[][] matrix)
Draw a matrix within a rectangle.
graphics (Graphics)Graphics object to draw with.
font (Font)Font to draw with.
colour (Color)Colour of matrix text and brackets.
frame (RectangleF)Rectangular frame.
matrix (string[][])Matrix to draw.

DrawOutsideShadow

#Example
public static void DrawOutsideShadow(this Graphics graphics, RectangleF area, ShadowSize size = ShadowSize.Medium)
Draw a drop shadow outside a rectangle, darkest along the rectangle's perimeter and fading outward. The shadow always wraps the entire rectangle: all four edges plus rounded corners. The pixel width and peak opacity for each preset are defined in ShadowPixelSize(ShadowSize) and ShadowPixelAlpha(ShadowSize).
graphics (Graphics)Graphics object to draw with.
area (RectangleF)Rectangle to draw the shadow around.
size (ShadowSize = ShadowSize.Medium)Preset shadow size.

DrawOutsideShadow

#Example
public static void DrawOutsideShadow(this Graphics graphics, RectangleF area, ShadowSize size, float opacity)
Draw a drop shadow as DrawOutsideShadow(Graphics, RectangleF, ShadowSize), but faded to the given opacity.
graphics (Graphics)Graphics object to draw with.
area (RectangleF)Rectangle to draw the shadow around.
size (ShadowSize)Preset shadow size.
opacity (float)Opacity multiplier (0.0 ~ 1.0) applied to the whole shadow.

DrawPointer

#Example
public static void DrawPointer(this Graphics graphics, Color colour, PointF target, float size, float angle, float offset)
Draw an arrow pointing at a location.
graphics (Graphics)Graphics object to draw with.
colour (Color)Colour of pointer.
target (PointF)Location being pointed at.
size (float)Size (length) of pointer in graphics units.
angle (float)Angle of pointer in degrees. Angle=0 means the shape is pointing to the right.
offset (float)Offset distance between target and pointer tip.

DrawPointer

#Example
public static void DrawPointer(this Graphics graphics, Color colour, PointF target, float size, float angle)
Draw an arrow pointing at a location.
graphics (Graphics)Graphics object to draw with.
colour (Color)Colour of pointer.
target (PointF)Location being pointed at.
size (float)Size (length) of pointer in graphics units.
angle (float)Angle of pointer in degrees. Angle=0 means the shape is pointing to the right.

DrawRuledPaper

#Example
public static IEnumerable<GraphicsExtensionMethods.RuledPaperLine> DrawRuledPaper(this Graphics graphics, RectangleF boundary, float marginX, float lineY, float lineSpacing, Color marginColour, Color lineColour)
Draw ruled paper with custom colours.
graphics (Graphics)Graphics object to draw with.
boundary (RectangleF)Paper boundary.
marginX (float)X coordinate of vertical margin.
lineY (float)Y coordinate of one of the lines.
lineSpacing (float)Vertical spacing between the lines.
marginColour (Color)The colour of the double margin line.
lineColour (Color)The colour of the horizontal rules.

DrawRuledPaper

#Example
public static IEnumerable<GraphicsExtensionMethods.RuledPaperLine> DrawRuledPaper(this Graphics graphics, RectangleF boundary, float marginX, float lineY, float lineSpacing)
Draw ruled paper with default colours.
graphics (Graphics)Graphics object to draw with.
boundary (RectangleF)Paper boundary.
marginX (float)X coordinate of vertical margin.
lineY (float)Y coordinate of one of the lines.
lineSpacing (float)Vertical spacing between the lines.

DrawRuledPaper

#Example
public static IEnumerable<GraphicsExtensionMethods.RuledPaperLine> DrawRuledPaper(this Graphics graphics, RectangleF boundary, float marginX, float[] lineY, Color marginColour, Color lineColour)
Draw ruled paper with custom colours.
graphics (Graphics)Graphics object to draw with.
boundary (RectangleF)Paper boundary.
marginX (float)X coordinate of vertical margin.
lineY (float[])Y coordinates of all lines.
marginColour (Color)The colour of the double margin line.
lineColour (Color)The colour of the horizontal rules.

DrawRuledPaper

#Example
public static IEnumerable<GraphicsExtensionMethods.RuledPaperLine> DrawRuledPaper(this Graphics graphics, RectangleF boundary, float marginX, float[] lineY)
Draw ruled paper with default colours.
graphics (Graphics)Graphics object to draw with.
boundary (RectangleF)Paper boundary.
marginX (float)X coordinate of vertical margin.
lineY (float[])Y coordinates of all lines.

DrawShape

#Example
public static void DrawShape(this Graphics graphics, BalloonF balloon, Color colour)
Draw a balloon using the specified colour.
graphics (Graphics)
balloon (BalloonF)
colour (Color)

DrawShape

#Example
public static void DrawShape(this Graphics graphics, BalloonF balloon, Shade shade)
Draw a balloon using the specified skin colours.
graphics (Graphics)
balloon (BalloonF)
shade (Shade)

DrawShape

#Example
public static void DrawShape(this Graphics graphics, DiscF disc, Color colour)
Draw a disc using the specified colour.
graphics (Graphics)
disc (DiscF)
colour (Color)

DrawShape

#Example
public static void DrawShape(this Graphics graphics, DiscF disc, Shade colour)
Draw a disc using the specified skin colours.
graphics (Graphics)
disc (DiscF)
colour (Shade)

DrawShape

#Example
public static void DrawShape(this Graphics graphics, SlabF slab, Color colour)
Draw a slab using the specified colour.
graphics (Graphics)
slab (SlabF)
colour (Color)

DrawShape

#Example
public static void DrawShape(this Graphics graphics, SlabF slab, Shade colour)
Draw a slab using the specified skin colours.
graphics (Graphics)
slab (SlabF)
colour (Shade)

DrawShape

#Example
public static void DrawShape(this Graphics graphics, TriangleF triangle, Color colour)
Draw a triangle using the specified colour.
graphics (Graphics)
triangle (TriangleF)
colour (Color)

DrawShape

#Example
public static void DrawShape(this Graphics graphics, TriangleF triangle, Shade colour)
Draw a triangle using the specified skin colours.
graphics (Graphics)
triangle (TriangleF)
colour (Shade)

DrawShapeBackground

#Example
public static void DrawShapeBackground(this Graphics graphics, SlabF slab, Shade colour)
Draw the background layers of a slab.
graphics (Graphics)
slab (SlabF)
colour (Shade)

DrawShapeForeground

#Example
public static void DrawShapeForeground(this Graphics graphics, SlabF slab, Shade colour)
Draw the background layers of a slab.
graphics (Graphics)
slab (SlabF)
colour (Shade)

DrawSolidBalloon

#Example
public static void DrawSolidBalloon(this Graphics graphics, string text, Color fill, Color textColour)
Draw a default balloon label.
Draw a solid balloon around a text, with the tip at the local origin. The balloon is drawn in the current transform and is meant to be placed via a translation to the tip and a scale to control coordinates.
graphics (Graphics)Graphics object to draw with.
text (string)Text inside the balloon.
fill (Color)Solid balloon colour.
textColour (Color)Colour of the text, ought to contrast with the fill.

DrawSunkenText

#Example
public static void DrawSunkenText(this Graphics graphics, PointF centre, Font font, Color colour, string text)
Draw sunken centered text.
graphics (Graphics)Graphics to draw with.
centre (PointF)Centre of text.
font (Font)Font to use.
colour (Color)Colour of text, should not contain an alpha component.
text (string)Text to draw.

DrawTextInFrame

#Example
public static void DrawTextInFrame(this Graphics graphics, Font font, Brush colour, string text, RectangleF frame, TextAlignment horizontal)
Draw trimmed and unwrapped text into the vertical centre of a frame.
graphics (Graphics)Graphics object to draw with.
font (Font)Font to use.
colour (Brush)Foreground colour.
text (string)Text to draw.
frame (RectangleF)Bounding frame.
horizontal (TextAlignment)Horizontal alignment.

DrawTextInFrame

#Example
public static void DrawTextInFrame(this Graphics graphics, Font font, Color colour, string text, RectangleF frame, TextAlignment horizontal)
Draw trimmed and unwrapped text into the vertical centre of a frame.
graphics (Graphics)Graphics object to draw with.
font (Font)Font to use.
colour (Color)Foreground colour.
text (string)Text to draw.
frame (RectangleF)Bounding frame.
horizontal (TextAlignment)Horizontal alignment.

FillArc

#Example
public static void FillArc(this Graphics graphics, Brush brush, ArcF arc)
Fill an arc.
graphics (Graphics)Graphics object to draw with.
brush (Brush)Fill brush.
arc (ArcF)Circle.

FillArc

#Example
public static void FillArc(this Graphics graphics, Color colour, ArcF arc)
Fill an arc.
graphics (Graphics)Graphics object to draw with.
colour (Color)Fill colour.
arc (ArcF)Circle.

FillBox

#Example
public static void FillBox(this Graphics graphics, BoxFAxo box, Color colour, float shading)
Draw the shading on a box using custom settings.
graphics (Graphics)Graphics object to draw with.
box (BoxFAxo)Box to draw.
colour (Color)Box colour.
shading (float)Shading strength.

FillBox

#Example
public static void FillBox(this Graphics graphics, BoxFAxo box, Color colour)
Draw the shading on a box using default settings.
graphics (Graphics)Graphics object to draw with.
box (BoxFAxo)Box to draw.
colour (Color)Box colour.

FillBox

#Example
public static void FillBox(this Graphics graphics, BoxFAxo box, Color front, Color right, Color top)
Draw the shading on the visible faces of a box using custom colours.
graphics (Graphics)Graphics object to draw with.
box (BoxFAxo)Box to draw.
front (Color)Colour of front face.
right (Color)Colour of right face.
top (Color)Colour of top face.

FillBox

#Example
public static void FillBox(this Graphics graphics, BoxFAxo box, params Color[] faceColours)
Draw the shading on the visible faces of a box using custom colours.
graphics (Graphics)Graphics object to draw with.
box (BoxFAxo)Box to draw.
faceColours (params Color[])Array of six colours, one for each face. The order is {bottom, left, back, top, right, front}.

FillCircle

#Example
public static void FillCircle(this Graphics graphics, Brush brush, CircleF circle)
Fill a circle.
graphics (Graphics)Graphics object to draw with.
brush (Brush)Fill brush.
circle (CircleF)Circle.

FillCircle

#Example
public static void FillCircle(this Graphics graphics, Color colour, CircleF circle)
Fill a circle.
graphics (Graphics)Graphics object to draw with.
colour (Color)Fill colour.
circle (CircleF)Circle.

FillCylinder

#Example
public static void FillCylinder(this Graphics graphics, CylinderFAxo cylinder, Color cap, Color sideLeft, Color sideRight, bool fromAbove)
Draw the shading of a cylinder.
graphics (Graphics)
cylinder (CylinderFAxo)
cap (Color)
sideLeft (Color)
sideRight (Color)
fromAbove (bool)If true, the top face of the cylinder is assumed to face the viewer.

FillCylinder

#Example
public static void FillCylinder(this Graphics graphics, CylinderFAxo cylinder, Color colour, bool fromAbove)
Draw the shading of a cylinder.
graphics (Graphics)Graphics object to draw with.
cylinder (CylinderFAxo)Cylinder.
colour (Color)Cylinder colour.
fromAbove (bool)If true, the top face of the cylinder is assumed to face the viewer.

FillCylinder

#Example
public static void FillCylinder(this Graphics graphics, CylinderFAxo cylinder, Color colour, float shading, bool fromAbove)
Draw the shading of a cylinder.
graphics (Graphics)
cylinder (CylinderFAxo)
colour (Color)
shading (float)
fromAbove (bool)If true, the top face of the cylinder is assumed to face the viewer.

FillDiamond

#Example
public static void FillDiamond(this Graphics graphics, Brush brush, Point centre, int radius)
Fill a diamond.
graphics (Graphics)Graphics object to draw with.
brush (Brush)Fill brush.
centre (Point)Centre of diamond.
radius (int)Radius of diamond (centre to corner).

FillDiamond

#Example
public static void FillDiamond(this Graphics graphics, Brush brush, PointF centre, float radius)
Fill a diamond.
graphics (Graphics)Graphics object to draw with.
brush (Brush)Fill brush.
centre (PointF)Centre of diamond.
radius (float)Radius of diamond (centre to corner).

FillDiamond

#Example
public static void FillDiamond(this Graphics graphics, Color colour, Point centre, int radius)
Fill a diamond.
graphics (Graphics)Graphics object to draw with.
colour (Color)Fill colour.
centre (Point)Centre of diamond.
radius (int)Radius of diamond (centre to corner).

FillDiamond

#Example
public static void FillDiamond(this Graphics graphics, Color colour, PointF centre, float radius)
Fill a diamond.
graphics (Graphics)Graphics object to draw with.
colour (Color)Fill colour.
centre (PointF)Centre of diamond.
radius (float)Radius of diamond (centre to corner).

FillEllipse

#Example
public static void FillEllipse(this Graphics graphics, Brush fill, EllipseF ellipse)
Fill an ellipse.
graphics (Graphics)Graphics object to draw with.
fill (Brush)Fill brush.
ellipse (EllipseF)Ellipse.

FillEllipse

#Example
public static void FillEllipse(this Graphics graphics, Color colour, EllipseF ellipse)
Fill an ellipse.
graphics (Graphics)Graphics object to draw with.
colour (Color)Fill colour.
ellipse (EllipseF)Ellipse.

FillLeftSemiCircle

#Example
public static void FillLeftSemiCircle(this Graphics graphics, Brush brush, CircleF circle)
Fill the left half of a circle.
graphics (Graphics)Graphics object to draw with.
brush (Brush)Fill brush.
circle (CircleF)Circle.

FillLeftSemiCircle

#Example
public static void FillLeftSemiCircle(this Graphics graphics, Color colour, CircleF circle)
Fill the left half of a circle.
graphics (Graphics)Graphics object to draw with.
colour (Color)Fill colour.
circle (CircleF)Circle.

FillMotif

#Example
public static void FillMotif(this Graphics graphics, GraphicsPath region, Motif motif)
Fill a region with a motif pattern.
graphics (Graphics)Graphics object to draw with.
region (GraphicsPath)Region to fill.
motif (Motif)Motif pattern.

FillMotif

#Example
public static void FillMotif(this Graphics graphics, GraphicsPath region, MotifFlavour flavour, MotifStrength strength, Color colour)
Fill a region with a hatch pattern.
graphics (Graphics)Graphics object to draw with.
region (GraphicsPath)Region to fill.
flavour (MotifFlavour)Hatch flavour.
strength (MotifStrength)Hatch strength.
colour (Color)Hatch colour.

FillMotif

#Example
public static void FillMotif(this Graphics graphics, RectangleF region, Motif motif)
Fill a region with a motif pattern.
graphics (Graphics)Graphics object to draw with.
region (RectangleF)Region to fill.
motif (Motif)Motif pattern.

FillMotif

#Example
public static void FillMotif(this Graphics graphics, RectangleF region, MotifFlavour flavour, MotifStrength strength, Color colour)
Fill a region with a hatch pattern.
graphics (Graphics)Graphics object to draw with.
region (RectangleF)Region to fill.
flavour (MotifFlavour)Hatch flavour.
strength (MotifStrength)Hatch strength.
colour (Color)Hatch colour.

FillPartialDiamond

#Example
public static void FillPartialDiamond(this Graphics graphics, Brush brush, DiamondPortion portion, Point centre, int radius)
Fill a diamond.
graphics (Graphics)Graphics object to draw with.
brush (Brush)Fill brush.
portion (DiamondPortion)Diamond portion to fill.
centre (Point)Centre of diamond.
radius (int)Radius of diamond (centre to corner).

FillPartialDiamond

#Example
public static void FillPartialDiamond(this Graphics graphics, Brush brush, DiamondPortion portion, PointF centre, float radius)
Fill a diamond.
graphics (Graphics)Graphics object to draw with.
brush (Brush)Fill brush.
portion (DiamondPortion)Diamond portion to fill.
centre (PointF)Centre of diamond.
radius (float)Radius of diamond (centre to corner).

FillPartialDiamond

#Example
public static void FillPartialDiamond(this Graphics graphics, Color colour, DiamondPortion portion, Point centre, int radius)
Fill a diamond.
graphics (Graphics)Graphics object to draw with.
colour (Color)Fill colour.
portion (DiamondPortion)Diamond portion to fill.
centre (Point)Centre of diamond.
radius (int)Radius of diamond (centre to corner).

FillPartialDiamond

#Example
public static void FillPartialDiamond(this Graphics graphics, Color colour, DiamondPortion portion, PointF centre, float radius)
Fill a diamond.
graphics (Graphics)Graphics object to draw with.
colour (Color)Fill colour.
portion (DiamondPortion)Diamond portion to fill.
centre (PointF)Centre of diamond.
radius (float)Radius of diamond (centre to corner).

FillRightSemiCircle

#Example
public static void FillRightSemiCircle(this Graphics graphics, Brush brush, CircleF circle)
Fill the right half of a circle.
graphics (Graphics)Graphics object to draw with.
brush (Brush)Fill brush.
circle (CircleF)Circle.

FillRightSemiCircle

#Example
public static void FillRightSemiCircle(this Graphics graphics, Color colour, CircleF circle)
Fill the right half of a circle.
graphics (Graphics)Graphics object to draw with.
colour (Color)Fill colour.
circle (CircleF)Circle.

FocusEdge

#Example
public static Color FocusEdge(this Graphics graphics)
Gets the colour to be used for drawing focus region outlines.
graphics (Graphics)

FocusFill

#Example
public static Color FocusFill(this Graphics graphics)
Gets the colour to be used for filling focus regions.
graphics (Graphics)

HoverEdge

#Example
public static Color HoverEdge(this Graphics graphics)
Gets the colour to be used for drawing hover region outlines.
graphics (Graphics)

HoverFill

#Example
public static Color HoverFill(this Graphics graphics)
Gets the colour to be used for filling hover regions.
graphics (Graphics)

MeasureCharacterRanges

#Example
public static RectangleF[] MeasureCharacterRanges(this Font font, string text, PointF anchor)
Determine the bounds of each character within a string.
font (Font)
text (string)
anchor (PointF)

MeasureCharacterRanges

#Example
public static RectangleF[] MeasureCharacterRanges(this Font font, string text, RectangleF frame, TextAlignment horizontal)
Determine the bounds of each character within a string.
font (Font)
text (string)
frame (RectangleF)
horizontal (TextAlignment)

MeasureCharacterRanges

#Example
public static SizeF[] MeasureCharacterRanges(this Font font, string text)
Measure the sizes of each character within a string.
font (Font)
text (string)

MeasureGraphemeRanges

#Example
public static RectangleF[] MeasureGraphemeRanges(this Font font, string text, PointF anchor)
Determine the bounds of each grapheme cluster within a string, laid out left to right from an anchor. Unlike MeasureCharacterRanges(Font, string, PointF) this returns one box per user-perceived character (base + combining marks, whole surrogate pairs), so it aligns with a grapheme-indexed caret.
font (Font)
text (string)
anchor (PointF)

MeasureGraphemeRanges

#Example
public static RectangleF[] MeasureGraphemeRanges(this Font font, string text, RectangleF frame, TextAlignment horizontal)
Determine the bounds of each grapheme cluster within a string, aligned inside a frame. The per-grapheme equivalent of MeasureCharacterRanges(Font, string, RectangleF, TextAlignment).
font (Font)
text (string)
frame (RectangleF)
horizontal (TextAlignment)

PaddedTextureBrush

#
public static Brush PaddedTextureBrush(Image image, float alpha, RectangleF frame, int padding)
Create a texture brush with a scaled image.
image (Image)Image to draw.
alpha (float)Alpha strength of brush.
frame (RectangleF)Target rectangle for image.
padding (int)Number of image pixels to put outside the rectangle edges.