GraphicsExtensionMethods
Provides extension methods for the Eto graphics object.
Fields
Methods
Add noise to an entire control.
Parameters:
| context (Context) | Graphics context. |
| flavour (NoiseFlavour) | Flavour of noise. |
| strength (float) | Strength of noise in the (0, 1) range. |
public static void AddNoise(this Graphics graphics, NoiseFlavour flavour, float strength, CircleF region)
Fill a region with noise.
Parameters:
| 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. |
public static void AddNoise(this Graphics graphics, NoiseFlavour flavour, float strength, GraphicsPath region)
Fill a region with noise.
Parameters:
| 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. |
public static void AddNoise(this Graphics graphics, NoiseFlavour flavour, float strength, RectangleF region)
Fill a region with noise.
Parameters:
| 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.
Parameters:
| graphics (Graphics) |
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.
Parameters:
| 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. |
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.
Parameters:
| 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. |
public static void DrawAngledText(this Graphics graphics, Font font, Color colour, string text, TextAnchor anchor, PointF point, float angle)
Draw rotated text.
Parameters:
| 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. |
Draw an arc.
Draw an arc.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| pen (Pen) | Edge edge. |
| arc (ArcF) | Arc. |
Draw an arrow.
Draw an arrow.
Draw an arrow at both ends of a line segment.
Draw a set of three dimples hinting at a draggable area.
Parameters:
| 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) |
Draw a balloon with a text label.
Parameters:
| 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. |
public static void DrawBalloonLabel(this Graphics graphics, PointF tip, string text, Font font, Color colour)
Parameters:
| graphics (Graphics) | |
| tip (PointF) | |
| text (string) | |
| font (Font) | |
| colour (Color) |
Draw a set of five dimples hinting at a draggable area.
Parameters:
| 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. |
Draw a bezier segment.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| pen (Pen) | Edge edge. |
| bezier (BezierF) | Bezier segment. |
Draw the edges of a box.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| box (BoxFAxo) | Box to draw. |
| edges (Pen) | Pen for all edges. |
public static void DrawBox(this Graphics graphics, BoxFAxo box, Pen silhouette, Pen interior, Pen hidden)
Draw the edges of a box.
Parameters:
| 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. |
Draw the edges of a box.
Parameters:
| 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. |
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.
Parameters:
| 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. |
public static void DrawCenteredText(this Graphics graphics, PointF centre, Font font, Brush fill, string text)
Draw centered text.
Parameters:
| 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. |
public static void DrawCenteredText(this Graphics graphics, PointF centre, Font font, Color colour, string text)
Draw centered text.
Parameters:
| 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. |
Draw a circle.
Draw a circle.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| pen (Pen) | Edge edge. |
| circle (CircleF) | Circle. |
public static void DrawColourPivot(this Graphics graphics, Color colour, PointF point, float radius)
Draw the standard pivot shape at the given location.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| colour (Color) | Pivot colour. |
| point (PointF) | Pivot location. |
| radius (float) | Pivot radius. |
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.
Parameters:
| 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. |
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.
Parameters:
| 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. |
Draw the wireframe of a cylinder.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| cylinder (CylinderFAxo) | Cylinder to draw. |
| edges (Pen) | Pen for the edges. |
public static void DrawCylinder(this Graphics graphics, CylinderFAxo cylinder, Pen silhouette, Pen interior, Pen hidden, bool fromAbove)
Draw the wireframe of a cylinder.
Parameters:
| 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. |
public static void DrawCylinder(this Graphics graphics, CylinderFAxo cylinder, Pen visible, Pen hidden, bool fromAbove)
Draw the wireframe of a cylinder.
Parameters:
| 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. |
public static void DrawDebugBox(this Graphics graphics, RectangleF box, Color colour)
Draw a dotted debug box handy while writing layout code.
Parameters:
| graphics (Graphics) | |
| box (RectangleF) | |
| colour (Color) |
Draw a set of dimples hinting at a draggable area.
Parameters:
| 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. |
public static void DrawDisabledMotif(this Graphics graphics, Control control)
Draw a standard disabled control motif.
Parameters:
| graphics (Graphics) | |
| control (Control) |
public static void DrawDisabledMotif(this Graphics graphics, RectangleF bounds)
Draw a standard disabled control motif.
Parameters:
| graphics (Graphics) | |
| bounds (RectangleF) |
Draw an ellipse.
Draw an ellipse.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| pen (Pen) | Edge edge. |
| ellipse (EllipseF) | Ellipse. |
Draw an arc which fades to transparency at both ends.
Draw an arc which fades to a different colour at both ends.
Draw a vertical block with fade-in and fade-out regions.
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.
Parameters:
| 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. |
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.
Parameters:
| 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. |
Draw a frame with a title.
Draw a frame with a title.
Draw a frame with a title.
public static void DrawFrame(this Graphics graphics, Rectangle rectangle, Color colour, string text)
Draw a frame with a title.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| rectangle (Rectangle) | Frame rectangle. |
| colour (Color) | Frame and text colour. |
| text (string) | Frame text. |
Draw a function within a frame.
Draw an image into a circle.
Draw an image into a rectangle.
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).
Parameters:
| 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. |
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.
Parameters:
| 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. |
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.
Parameters:
| 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. |
Draw a line.
Draw a line.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| pen (Pen) | Edge edge. |
| line (LineF) | Line. |
Draw a line through a box.
Parameters:
| 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. |
Draw a line through a box.
Parameters:
| 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. |
public static void DrawLineThroughBox(this Graphics graphics, RectangleF box, Color colour, PointF point0, PointF point1)
Draw a line through a box.
Parameters:
| 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. |
public static void DrawLineThroughBox(this Graphics graphics, RectangleF box, Pen pen, PointF point0, PointF point1)
Draw a line through a box.
Parameters:
| 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. |
public static void DrawMarker(this Graphics graphics, Family colour, RectangleF target, RectangleF framing)
Draw a circle and arrow around a target box.
Parameters:
| 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. |
Draw a matrix within a rectangle.
Parameters:
| 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. |
public static void DrawMatrix(this Graphics graphics, Font font, Color colour, RectangleF frame, double[][] matrix)
Draw a matrix within a rectangle.
Parameters:
| 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, |
public static void DrawMatrix(this Graphics graphics, Font font, Color colour, RectangleF frame, int[][] matrix)
Draw a matrix within a rectangle.
Parameters:
| 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, |
public static void DrawMatrix(this Graphics graphics, Font font, Color colour, RectangleF frame, string[][] matrix)
Draw a matrix within a rectangle.
Parameters:
| 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. |
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).
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| area (RectangleF) | Rectangle to draw the shadow around. |
| size (ShadowSize = ShadowSize.Medium) | Preset shadow size. |
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.
Parameters:
| 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. |
Draw an arrow pointing at a location.
Parameters:
| 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. |
Draw an arrow pointing at a location.
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.
Parameters:
| 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. |
public static IEnumerable<GraphicsExtensionMethods.RuledPaperLine> DrawRuledPaper(this Graphics graphics, RectangleF boundary, float marginX, float lineY, float lineSpacing)
Draw ruled paper with default colours.
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.
public static IEnumerable<GraphicsExtensionMethods.RuledPaperLine> DrawRuledPaper(this Graphics graphics, RectangleF boundary, float marginX, float[] lineY)
Draw ruled paper with default colours.
Draw a balloon using the specified colour.
Parameters:
| graphics (Graphics) | |
| balloon (BalloonF) | |
| colour (Color) |
Draw a balloon using the specified skin colours.
Draw a disc using the specified skin colours.
Draw a slab using the specified skin colours.
Draw a triangle using the specified colour.
Parameters:
| graphics (Graphics) | |
| triangle (TriangleF) | |
| colour (Color) |
Draw a triangle using the specified skin colours.
Draw the background layers of a slab.
Draw the background layers of a slab.
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.
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.
Parameters:
| 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. |
public static void DrawSunkenText(this Graphics graphics, PointF centre, Font font, Color colour, string text)
Draw sunken centered text.
Parameters:
| 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. |
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.
Parameters:
| 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. |
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.
Parameters:
| 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. |
Fill an arc.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| brush (Brush) | Fill brush. |
| arc (ArcF) | Circle. |
Fill an arc.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| colour (Color) | Fill colour. |
| arc (ArcF) | Circle. |
Draw the shading on a box using custom settings.
Draw the shading on a box using default settings.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| box (BoxFAxo) | Box to draw. |
| colour (Color) | Box colour. |
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.
Parameters:
| 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. |
Draw the shading on the visible faces of a box using custom colours.
Parameters:
| 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}. |
Fill a circle.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| brush (Brush) | Fill brush. |
| circle (CircleF) | Circle. |
Fill a circle.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| colour (Color) | Fill colour. |
| circle (CircleF) | Circle. |
public static void FillCylinder(this Graphics graphics, CylinderFAxo cylinder, Color cap, Color sideLeft, Color sideRight, bool fromAbove)
Draw the shading of a cylinder.
Parameters:
| 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. |
public static void FillCylinder(this Graphics graphics, CylinderFAxo cylinder, Color colour, bool fromAbove)
Draw the shading of a cylinder.
Parameters:
| 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. |
public static void FillCylinder(this Graphics graphics, CylinderFAxo cylinder, Color colour, float shading, bool fromAbove)
Draw the shading of a cylinder.
Parameters:
| graphics (Graphics) | |
| cylinder (CylinderFAxo) | |
| colour (Color) | |
| shading (float) | |
| fromAbove (bool) | If true, the top face of the cylinder is assumed to face the viewer. |
Fill a diamond.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| brush (Brush) | Fill brush. |
| centre (Point) | Centre of diamond. |
| radius (int) | Radius of diamond (centre to corner). |
Fill a diamond.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| brush (Brush) | Fill brush. |
| centre (PointF) | Centre of diamond. |
| radius (float) | Radius of diamond (centre to corner). |
Fill a diamond.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| colour (Color) | Fill colour. |
| centre (Point) | Centre of diamond. |
| radius (int) | Radius of diamond (centre to corner). |
Fill a diamond.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| colour (Color) | Fill colour. |
| centre (PointF) | Centre of diamond. |
| radius (float) | Radius of diamond (centre to corner). |
Fill an ellipse.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| fill (Brush) | Fill brush. |
| ellipse (EllipseF) | Ellipse. |
Fill an ellipse.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| colour (Color) | Fill colour. |
| ellipse (EllipseF) | Ellipse. |
Fill the left half of a circle.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| brush (Brush) | Fill brush. |
| circle (CircleF) | Circle. |
Fill the left half of a circle.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| colour (Color) | Fill colour. |
| circle (CircleF) | Circle. |
Fill a region with a motif pattern.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| region (GraphicsPath) | Region to fill. |
| motif (Motif) | Motif pattern. |
public static void FillMotif(this Graphics graphics, GraphicsPath region, MotifFlavour flavour, MotifStrength strength, Color colour)
Fill a region with a hatch pattern.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| region (GraphicsPath) | Region to fill. |
| flavour (MotifFlavour) | Hatch flavour. |
| strength (MotifStrength) | Hatch strength. |
| colour (Color) | Hatch colour. |
Fill a region with a motif pattern.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| region (RectangleF) | Region to fill. |
| motif (Motif) | Motif pattern. |
public static void FillMotif(this Graphics graphics, RectangleF region, MotifFlavour flavour, MotifStrength strength, Color colour)
Fill a region with a hatch pattern.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| region (RectangleF) | Region to fill. |
| flavour (MotifFlavour) | Hatch flavour. |
| strength (MotifStrength) | Hatch strength. |
| colour (Color) | Hatch colour. |
public static void FillPartialDiamond(this Graphics graphics, Brush brush, DiamondPortion portion, Point centre, int radius)
Fill a diamond.
Parameters:
| 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). |
public static void FillPartialDiamond(this Graphics graphics, Brush brush, DiamondPortion portion, PointF centre, float radius)
Fill a diamond.
Parameters:
| 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). |
public static void FillPartialDiamond(this Graphics graphics, Color colour, DiamondPortion portion, Point centre, int radius)
Fill a diamond.
Parameters:
| 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). |
public static void FillPartialDiamond(this Graphics graphics, Color colour, DiamondPortion portion, PointF centre, float radius)
Fill a diamond.
Parameters:
| 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). |
Fill the right half of a circle.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| brush (Brush) | Fill brush. |
| circle (CircleF) | Circle. |
Fill the right half of a circle.
Parameters:
| graphics (Graphics) | Graphics object to draw with. |
| colour (Color) | Fill colour. |
| circle (CircleF) | Circle. |
public static Color FocusEdge(this Graphics graphics)
Gets the colour to be used for drawing focus region outlines.
Parameters:
| graphics (Graphics) |
public static Color FocusFill(this Graphics graphics)
Gets the colour to be used for filling focus regions.
Parameters:
| graphics (Graphics) |
public static Color HoverEdge(this Graphics graphics)
Gets the colour to be used for drawing hover region outlines.
Parameters:
| graphics (Graphics) |
public static Color HoverFill(this Graphics graphics)
Gets the colour to be used for filling hover regions.
Parameters:
| graphics (Graphics) |
Determine the bounds of each character within a string.
Parameters:
| font (Font) | |
| text (string) | |
| anchor (PointF) |
public static RectangleF[] MeasureCharacterRanges(this Font font, string text, RectangleF frame, TextAlignment horizontal)
Determine the bounds of each character within a string.
Parameters:
| font (Font) | |
| text (string) | |
| frame (RectangleF) | |
| horizontal (TextAlignment) |
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.
Parameters:
| font (Font) | |
| text (string) | |
| anchor (PointF) |
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).
Parameters:
| font (Font) | |
| text (string) | |
| frame (RectangleF) | |
| horizontal (TextAlignment) |
PaddedTextureBrush
#Create a texture brush with a scaled image.