VectSharp 2.5.0
A light library for C# vector graphics
|
Represents an abstract drawing surface. More...
Public Member Functions | |
void | FillPath (GraphicsPath path, Brush fillColour, string tag=null) |
Fill a GraphicsPath. More... | |
void | FillPath (GraphicsPath path, Brush fillColour, FillRule fillRule, string tag=null) |
Fill a GraphicsPath. More... | |
void | StrokePath (GraphicsPath path, Brush strokeColour, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke a GraphicsPath. More... | |
void | SetClippingPath (GraphicsPath path, string tag=null) |
Intersect the current clipping path with the specified GraphicsPath. More... | |
void | SetClippingPath (double leftX, double topY, double width, double height, string tag=null) |
Intersect the current clipping path with the specified rectangle. More... | |
void | SetClippingPath (Point topLeft, Size size, string tag=null) |
Intersect the current clipping path with the specified rectangle. More... | |
void | Rotate (double angle, string tag=null) |
Rotate the coordinate system around the origin. More... | |
void | RotateAt (double angle, Point pivot, string tag=null) |
Rotate the coordinate system around a pivot point. More... | |
void | Transform (double a, double b, double c, double d, double e, double f, string tag=null) |
Transform the coordinate system with the specified transformation matrix [ [a, c, e], [b, d, f], [0, 0, 1] ]. More... | |
void | Translate (double x, double y, string tag=null) |
Translate the coordinate system origin. More... | |
void | Translate (Point delta, string tag=null) |
Translate the coordinate system origin. More... | |
void | Scale (double scaleX, double scaleY, string tag=null) |
Scale the coordinate system with respect to the origin. More... | |
void | FillRectangle (Point topLeft, Size size, Brush fillColour, string tag=null) |
Fill a rectangle. More... | |
void | FillRectangle (double leftX, double topY, double width, double height, Brush fillColour, string tag=null) |
Fill a rectangle. More... | |
void | StrokeRectangle (Point topLeft, Size size, Brush strokeColour, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke a rectangle. More... | |
void | StrokeRectangle (double leftX, double topY, double width, double height, Brush strokeColour, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke a rectangle. More... | |
void | DrawRasterImage (int sourceX, int sourceY, int sourceWidth, int sourceHeight, double destinationX, double destinationY, double destinationWidth, double destinationHeight, RasterImage image, string tag=null) |
Draw a raster image. More... | |
void | DrawRasterImage (double x, double y, RasterImage image, string tag=null) |
Draw a raster image. More... | |
void | DrawRasterImage (Point position, RasterImage image, string tag=null) |
Draw a raster image. More... | |
void | DrawRasterImage (double x, double y, double width, double height, RasterImage image, string tag=null) |
Draw a raster image. More... | |
void | DrawRasterImage (Point position, Size size, RasterImage image, string tag=null) |
Draw a raster image. More... | |
void | Save () |
Save the current transform state (rotation, translation, scale). More... | |
void | Restore () |
Restore the previous transform state (rotation, translation scale). More... | |
void | CopyToIGraphicsContext (IGraphicsContext destinationContext) |
Copy the current graphics to an instance of a class implementing IGraphicsContext. More... | |
void | DrawGraphics (Point origin, Graphics graphics) |
Draws a Graphics object on the current Graphics object. More... | |
void | DrawGraphics (double originX, double originY, Graphics graphics, string tag) |
Draws a Graphics object on the current Graphics object, prepending the supplied tag to the tags contained in the Graphics object being drawn. More... | |
void | DrawGraphics (Point origin, Graphics graphics, string tag) |
Draws a Graphics object on the current Graphics object, prepending the supplied tag to the tags contained in the Graphics object being drawn. More... | |
void | DrawGraphics (double originX, double originY, Graphics graphics) |
Draws a Graphics object on the current Graphics object. More... | |
void | DrawGraphics (Point origin, Graphics graphics, IFilter filter, string tag=null) |
Draws a Graphics object on the current Graphics object, applying the specified filter . More... | |
void | DrawGraphics (double originX, double originY, Graphics graphics, IFilter filter, string tag=null) |
Draws a Graphics object on the current Graphics object, applying the specified filter . More... | |
Graphics | Transform (Func< Point, Point > transformationFunction, double linearisationResolution) |
Creates a new Graphics object in which all the graphics actions have been transformed using an arbitrary transformation function. Raster images are replaced by grey rectangles. More... | |
Graphics | Transform (Func< Point, Point > transformationFunction, double linearisationResolution, double maxSegmentLength) |
Creates a new Graphics object in which all the graphics actions have been transformed using an arbitrary transformation function. Raster images are replaced by grey rectangles. More... | |
Graphics | Linearise (double resolution) |
Creates a new Graphics object by linearising all of the elements of the current instance, i.e. replacing curve segments with series of line segments that approximate them. Raster images are left unchanged. More... | |
Rectangle | GetBounds () |
Computes the rectangular bounds of the region affected by the drawing operations performed on the Graphics object. More... | |
bool | TryRasterise (Rectangle region, double scale, bool interpolate, out RasterImage output) |
Tries to rasterise specified region of this Graphics object using the default rasterisation method. More... | |
void | Crop (Rectangle region) |
Removes graphics actions that fall completely outside of the specified region . More... | |
void | Crop (Point topLeft, Size size) |
Removes graphics actions that fall completely outside of the specified region. More... | |
IEnumerable< string > | GetTags () |
Gets all the tags that have been defined in the Graphics. More... | |
void | FillText (Point origin, string text, Font font, Brush fillColour, TextBaselines textBaseline=TextBaselines.Top, string tag=null) |
Fill a text string. More... | |
void | FillText (double originX, double originY, string text, Font font, Brush fillColour, TextBaselines textBaseline=TextBaselines.Top, string tag=null) |
Fill a text string. More... | |
void | StrokeText (Point origin, string text, Font font, Brush strokeColour, TextBaselines textBaseline=TextBaselines.Top, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke a text string. More... | |
void | StrokeText (double originX, double originY, string text, Font font, Brush strokeColour, TextBaselines textBaseline=TextBaselines.Top, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke a text string. More... | |
void | FillTextOnPath (GraphicsPath path, string text, Font font, Brush fillColour, double reference=0, TextAnchors anchor=TextAnchors.Left, TextBaselines textBaseline=TextBaselines.Top, string tag=null) |
Fill a text string along a GraphicsPath. More... | |
void | StrokeTextOnPath (GraphicsPath path, string text, Font font, Brush strokeColour, double reference=0, TextAnchors anchor=TextAnchors.Left, TextBaselines textBaseline=TextBaselines.Top, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke a text string along a GraphicsPath. More... | |
void | FillText (Point origin, IEnumerable< FormattedText > text, Brush fillColour, TextBaselines textBaseline=TextBaselines.Top, string tag=null) |
Fill a formatted text string. More... | |
void | FillText (double originX, double originY, IEnumerable< FormattedText > text, Brush fillColour, TextBaselines textBaseline=TextBaselines.Top, string tag=null) |
Fill a formatted text string. More... | |
void | StrokeText (Point origin, IEnumerable< FormattedText > text, Brush strokeColour, TextBaselines textBaseline=TextBaselines.Top, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke a formatted text string. More... | |
void | StrokeText (double originX, double originY, IEnumerable< FormattedText > text, Brush strokeColour, TextBaselines textBaseline=TextBaselines.Top, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke a formatted text string. More... | |
Size | MeasureText (string text, Font font) |
Measure a text string. See also
and . More... | |
Size | MeasureText (IEnumerable< FormattedText > text) |
Measure a formatted text string. See also
. More... | |
void | FillTextUnderline (double originX, double originY, string text, Font font, Brush fillColour, TextBaselines textBaseline=TextBaselines.Top, string tag=null) |
Fills the underline of the specified text string. More... | |
void | FillTextUnderline (Point origin, string text, Font font, Brush fillColour, TextBaselines textBaseline=TextBaselines.Top, string tag=null) |
Fills the underline of the specified text string. More... | |
void | StrokeTextUnderline (double originX, double originY, string text, Font font, Brush strokeColour, TextBaselines textBaseline=TextBaselines.Top, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke the underline of the specified text string. More... | |
void | StrokeTextUnderline (Point origin, string text, Font font, Brush strokeColour, TextBaselines textBaseline=TextBaselines.Top, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke the underline of the specified text string. More... | |
void | FillTextUnderline (double originX, double originY, IEnumerable< FormattedText > text, Brush fillColour, TextBaselines textBaseline=TextBaselines.Top, string tag=null) |
Fill the underline of the specified formatted text string. More... | |
void | FillTextUnderline (Point origin, IEnumerable< FormattedText > text, Brush fillColour, TextBaselines textBaseline=TextBaselines.Top, string tag=null) |
Fill the underline of the specified formatted text string. More... | |
void | StrokeTextUnderline (double originX, double originY, IEnumerable< FormattedText > text, Brush strokeColour, TextBaselines textBaseline=TextBaselines.Top, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke the underline of the specified formatted text string. More... | |
void | StrokeTextUnderline (Point origin, IEnumerable< FormattedText > text, Brush strokeColour, TextBaselines textBaseline=TextBaselines.Top, double lineWidth=1, LineCaps lineCap=LineCaps.Butt, LineJoins lineJoin=LineJoins.Miter, LineDash? lineDash=null, string tag=null) |
Stroke the underline of the specified formatted text string. More... | |
Static Public Attributes | |
static Func< Graphics, Rectangle, double, bool, RasterImage > | RasterisationMethod = null |
A method that is used to rasterise a region of a Graphics object. Set this to null if you wish to use the default rasterisation methods (implemented by either VectSharp.Raster, or VectSharp.Raster.ImageSharp). You will have to provide your own implementation of this method if neither VectSharp.Raster nor VectSharp.Raster.ImageSharp are referenced by your project. The first argument of this method is the Graphics to be rasterised, the second is a Rectangle representing the region to rasterise, the third is a double representing the scale, and the third is a boolean value indicating whether the resulting RasterImage should be interpolated. More... | |
Properties | |
static UnbalancedStackActions | UnbalancedStackAction = UnbalancedStackActions.Throw [get, set] |
Determines how an unbalanced graphics state stack (which occurs if the number of calls to Save and Restore is not equal) will be treated. The default is UnbalancedStackActions.Throw. More... | |
FillRule | DefaultFillRule = FillRule.NonZeroWinding [get, set] |
The default fill rule. More... | |
bool | UseUniqueTags = true [get, set] |
Determines whether unique tags should be used for graphics actions that create multiple objects (e.g. drawing text). More... | |
Represents an abstract drawing surface.
Definition at line 278 of file Graphics.cs.
void VectSharp.Graphics.CopyToIGraphicsContext | ( | IGraphicsContext | destinationContext | ) |
Copy the current graphics to an instance of a class implementing IGraphicsContext.
destinationContext | The IGraphicsContext on which the graphics are to be copied. |
Definition at line 666 of file Graphics.cs.
Removes graphics actions that fall completely outside of the specified region.
topLeft | The top-left corner of the area to preserve. |
size | The size of the area to preserve. |
Definition at line 1695 of file Graphics.cs.
void VectSharp.Graphics.Crop | ( | Rectangle | region | ) |
Removes graphics actions that fall completely outside of the specified region .
region | The area to preserve. |
Definition at line 1606 of file Graphics.cs.
void VectSharp.Graphics.DrawGraphics | ( | double | originX, |
double | originY, | ||
Graphics | graphics | ||
) |
Draws a Graphics object on the current Graphics object.
originX | The horizontal coordinate at which to place the origin of graphics . |
originY | The vertical coordinate at which to place the origin of graphics . |
graphics | The Graphics object to draw on the current Graphics object. |
Definition at line 950 of file Graphics.cs.
void VectSharp.Graphics.DrawGraphics | ( | double | originX, |
double | originY, | ||
Graphics | graphics, | ||
IFilter | filter, | ||
string | tag = null |
||
) |
Draws a Graphics object on the current Graphics object, applying the specified filter .
originX | The horizontal coordinate at which to place the origin of graphics . |
originY | The vertical coordinate at which to place the origin of graphics . |
graphics | The Graphics object to draw on the current Graphics object. |
filter | An IFilter object, representing the filter to apply to the graphics object. |
tag | A tag to identify the filter. |
Definition at line 992 of file Graphics.cs.
void VectSharp.Graphics.DrawGraphics | ( | double | originX, |
double | originY, | ||
Graphics | graphics, | ||
string | tag | ||
) |
Draws a Graphics object on the current Graphics object, prepending the supplied tag to the tags contained in the Graphics object being drawn.
originX | The horizontal coordinate at which to place the origin of graphics . |
originY | The vertical coordinate at which to place the origin of graphics . |
graphics | The Graphics object to draw on the current Graphics object. |
tag | The tag to prepend to the tags contained in the graphics object. |
Definition at line 893 of file Graphics.cs.
void VectSharp.Graphics.DrawGraphics | ( | Point | origin, |
Graphics | graphics, | ||
IFilter | filter, | ||
string | tag = null |
||
) |
Draws a Graphics object on the current Graphics object, applying the specified filter .
origin | The point at which to place the origin of graphics . |
graphics | The Graphics object to draw on the current Graphics object. |
filter | An IFilter object, representing the filter to apply to the graphics object. |
tag | A tag to identify the filter. |
Definition at line 962 of file Graphics.cs.
Draws a Graphics object on the current Graphics object, prepending the supplied tag to the tags contained in the Graphics object being drawn.
origin | The point at which to place the origin of graphics . |
graphics | The Graphics object to draw on the current Graphics object. |
tag | The tag to prepend to the tags contained in the graphics object. |
Definition at line 904 of file Graphics.cs.
void VectSharp.Graphics.DrawRasterImage | ( | double | x, |
double | y, | ||
double | width, | ||
double | height, | ||
RasterImage | image, | ||
string | tag = null |
||
) |
Draw a raster image.
x | The horizontal coordinate of the top-left corner of the rectangle delimiting the destination area of the image. |
y | The vertical coordinate of the top-left corner of the rectangle delimiting the destination area of the image. |
width | The width of the rectangle delimiting the destination area of the image. |
height | The height of the rectangle delimiting the destination area of the image. |
image | The image to draw. |
tag | A tag to identify the drawn image. |
Definition at line 571 of file Graphics.cs.
void VectSharp.Graphics.DrawRasterImage | ( | double | x, |
double | y, | ||
RasterImage | image, | ||
string | tag = null |
||
) |
Draw a raster image.
x | The horizontal coordinate of the top-left corner of the rectangle delimiting the destination area of the image. |
y | The vertical coordinate of the top-left corner of the rectangle delimiting the destination area of the image. |
image | The image to draw. |
tag | A tag to identify the drawn image. |
Definition at line 546 of file Graphics.cs.
void VectSharp.Graphics.DrawRasterImage | ( | int | sourceX, |
int | sourceY, | ||
int | sourceWidth, | ||
int | sourceHeight, | ||
double | destinationX, | ||
double | destinationY, | ||
double | destinationWidth, | ||
double | destinationHeight, | ||
RasterImage | image, | ||
string | tag = null |
||
) |
Draw a raster image.
sourceX | The horizontal coordinate of the top-left corner of the rectangle delimiting the source area of the image. |
sourceY | The vertical coordinate of the top-left corner of the rectangle delimiting the source area of the image. |
sourceWidth | The width of the rectangle delimiting the source area of the image. |
sourceHeight | The height of the rectangle delimiting the source area of the image. |
destinationX | The horizontal coordinate of the top-left corner of the rectangle delimiting the destination area of the image. |
destinationY | The vertical coordinate of the top-left corner of the rectangle delimiting the destination area of the image. |
destinationWidth | The width of the rectangle delimiting the destination area of the image. |
destinationHeight | The height of the rectangle delimiting the destination area of the image. |
image | The image to draw. |
tag | A tag to identify the drawn image. |
Definition at line 534 of file Graphics.cs.
void VectSharp.Graphics.DrawRasterImage | ( | Point | position, |
RasterImage | image, | ||
string | tag = null |
||
) |
Draw a raster image.
position | The the top-left corner of the rectangle delimiting the destination area of the image. |
image | The image to draw. |
tag | A tag to identify the drawn image. |
Definition at line 557 of file Graphics.cs.
void VectSharp.Graphics.DrawRasterImage | ( | Point | position, |
Size | size, | ||
RasterImage | image, | ||
string | tag = null |
||
) |
Draw a raster image.
position | The the top-left corner of the rectangle delimiting the destination area of the image. |
size | The size of the rectangle delimiting the destination area of the image. |
image | The image to draw. |
tag | A tag to identify the drawn image. |
Definition at line 583 of file Graphics.cs.
void VectSharp.Graphics.FillPath | ( | GraphicsPath | path, |
Brush | fillColour, | ||
FillRule | fillRule, | ||
string | tag = null |
||
) |
Fill a GraphicsPath.
path | The GraphicsPath to fill. |
fillColour | The Brush with which to fill the GraphicsPath. |
fillRule | The FillRule that determines which parts of the path are filled. |
tag | A tag to identify the filled path. |
Definition at line 310 of file Graphics.cs.
void VectSharp.Graphics.FillPath | ( | GraphicsPath | path, |
Brush | fillColour, | ||
string | tag = null |
||
) |
Fill a GraphicsPath.
path | The GraphicsPath to fill. |
fillColour | The Brush with which to fill the GraphicsPath. |
tag | A tag to identify the filled path. |
Definition at line 298 of file Graphics.cs.
void VectSharp.Graphics.FillRectangle | ( | double | leftX, |
double | topY, | ||
double | width, | ||
double | height, | ||
Brush | fillColour, | ||
string | tag = null |
||
) |
Fill a rectangle.
leftX | The horizontal coordinate of the top-left corner of the rectangle. |
topY | The vertical coordinate of the top-left corner of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
fillColour | The colour with which to fill the rectangle. |
tag | A tag to identify the filled rectangle. |
Definition at line 482 of file Graphics.cs.
void VectSharp.Graphics.FillRectangle | ( | Point | topLeft, |
Size | size, | ||
Brush | fillColour, | ||
string | tag = null |
||
) |
Fill a rectangle.
topLeft | The top-left corner of the rectangle. |
size | The size of the rectangle. |
fillColour | The colour with which to fill the rectangle. |
tag | A tag to identify the filled rectangle. |
Definition at line 468 of file Graphics.cs.
void VectSharp.Graphics.FillText | ( | double | originX, |
double | originY, | ||
IEnumerable< FormattedText > | text, | ||
Brush | fillColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
string | tag = null |
||
) |
Fill a formatted text string.
originX | The horizontal coordinate of the text origin. |
originY | The vertical coordinate of the text origin. See textBaseline . |
text | The FormattedText to draw. |
fillColour | The default Brush to use to fill the text. This can be overridden by each text element. |
textBaseline | The text baseline (determines what originY represents). |
tag | A tag to identify the filled text. |
Definition at line 512 of file Graphics.Text.cs.
void VectSharp.Graphics.FillText | ( | double | originX, |
double | originY, | ||
string | text, | ||
Font | font, | ||
Brush | fillColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
string | tag = null |
||
) |
Fill a text string.
originX | The horizontal coordinate of the text origin. |
originY | The vertical coordinate of the text origin. See textBaseline . |
text | The string to draw. |
font | The font with which to draw the text. |
fillColour | The Brush to use to fill the text. |
textBaseline | The text baseline (determines what originY represents). |
tag | A tag to identify the filled text. |
Definition at line 57 of file Graphics.Text.cs.
void VectSharp.Graphics.FillText | ( | Point | origin, |
IEnumerable< FormattedText > | text, | ||
Brush | fillColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
string | tag = null |
||
) |
Fill a formatted text string.
origin | The text origin. See textBaseline . |
text | The FormattedText to draw. |
fillColour | The default Brush to use to fill the text. This can be overridden by each text element. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
tag | A tag to identify the filled text. |
Definition at line 411 of file Graphics.Text.cs.
void VectSharp.Graphics.FillText | ( | Point | origin, |
string | text, | ||
Font | font, | ||
Brush | fillColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
string | tag = null |
||
) |
Fill a text string.
origin | The text origin. See textBaseline . |
text | The string to draw. |
font | The font with which to draw the text. |
fillColour | The Brush to use to fill the text. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
tag | A tag to identify the filled text. |
Definition at line 34 of file Graphics.Text.cs.
void VectSharp.Graphics.FillTextOnPath | ( | GraphicsPath | path, |
string | text, | ||
Font | font, | ||
Brush | fillColour, | ||
double | reference = 0 , |
||
TextAnchors | anchor = TextAnchors.Left , |
||
TextBaselines | textBaseline = TextBaselines.Top , |
||
string | tag = null |
||
) |
Fill a text string along a GraphicsPath.
path | The GraphicsPath along which the text will flow. |
text | The string to draw. |
font | The font with which to draw the text. |
fillColour | The Brush to use to fill the text. |
reference | The (relative) starting point on the path starting from which the text should be drawn (0 is the start of the path, 1 is the end of the path). |
anchor | The anchor in the text string that will correspond to the point specified by the reference . |
textBaseline | The text baseline (determines which the position of the text in relation to the path . |
tag | A tag to identify the filled text. |
Definition at line 134 of file Graphics.Text.cs.
void VectSharp.Graphics.FillTextUnderline | ( | double | originX, |
double | originY, | ||
IEnumerable< FormattedText > | text, | ||
Brush | fillColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
string | tag = null |
||
) |
Fill the underline of the specified formatted text string.
originX | The horizontal coordinate of the text origin. |
originY | The vertical coordinate of the text origin. See textBaseline . |
text | The FormattedText whose underline will be drawn. |
fillColour | The default Brush to use to fill the underline. This can be overridden by each text element. |
textBaseline | The text baseline (determines what originY represents). |
tag | A tag to identify the filled underlined. |
Definition at line 754 of file Graphics.Text.cs.
void VectSharp.Graphics.FillTextUnderline | ( | double | originX, |
double | originY, | ||
string | text, | ||
Font | font, | ||
Brush | fillColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
string | tag = null |
||
) |
Fills the underline of the specified text string.
originX | The horizontal coordinate of the text origin. |
originY | The vertical coordinate of the text origin. See textBaseline . |
text | The string whose underline will be draw. |
font | The font with which to draw the text. |
fillColour | The Brush to use to fill the underline. |
textBaseline | The text baseline (determines what originY represents). |
tag | A tag to identify the filled underline. |
Definition at line 680 of file Graphics.Text.cs.
void VectSharp.Graphics.FillTextUnderline | ( | Point | origin, |
IEnumerable< FormattedText > | text, | ||
Brush | fillColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
string | tag = null |
||
) |
Fill the underline of the specified formatted text string.
origin | The text origin. See textBaseline . |
text | The FormattedText whose underline will be drawn. |
fillColour | The default Brush to use to fill the underline. This can be overridden by each text element. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
tag | A tag to identify the filled underlined. |
Definition at line 767 of file Graphics.Text.cs.
void VectSharp.Graphics.FillTextUnderline | ( | Point | origin, |
string | text, | ||
Font | font, | ||
Brush | fillColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
string | tag = null |
||
) |
Fills the underline of the specified text string.
origin | The text origin. See textBaseline . |
text | The string whose underline will be draw. |
font | The font with which to draw the text. |
fillColour | The Brush to use to fill the underline. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
tag | A tag to identify the filled underline. |
Definition at line 694 of file Graphics.Text.cs.
Rectangle VectSharp.Graphics.GetBounds | ( | ) |
Computes the rectangular bounds of the region affected by the drawing operations performed on the Graphics object.
Definition at line 1453 of file Graphics.cs.
IEnumerable< string > VectSharp.Graphics.GetTags | ( | ) |
Gets all the tags that have been defined in the Graphics.
Definition at line 1705 of file Graphics.cs.
Graphics VectSharp.Graphics.Linearise | ( | double | resolution | ) |
Creates a new Graphics object by linearising all of the elements of the current instance, i.e. replacing curve segments with series of line segments that approximate them. Raster images are left unchanged.
resolution | The resolution that will be used to linearise curve segments. |
Definition at line 1397 of file Graphics.cs.
Size VectSharp.Graphics.MeasureText | ( | IEnumerable< FormattedText > | text | ) |
Measure a formatted text string. See also
.
text | The collection of FormattedText objects to measure. |
Definition at line 663 of file Graphics.Text.cs.
Measure a text string. See also
and .
text | The string to measure. |
font | The font to use to measure the string. |
Definition at line 645 of file Graphics.Text.cs.
void VectSharp.Graphics.Restore | ( | ) |
Restore the previous transform state (rotation, translation scale).
Definition at line 599 of file Graphics.cs.
void VectSharp.Graphics.Rotate | ( | double | angle, |
string | tag = null |
||
) |
Rotate the coordinate system around the origin.
angle | The angle (in radians) by which to rotate the coordinate system. |
tag | A tag to identify the transform. |
Definition at line 374 of file Graphics.cs.
void VectSharp.Graphics.RotateAt | ( | double | angle, |
Point | pivot, | ||
string | tag = null |
||
) |
Rotate the coordinate system around a pivot point.
angle | The angle (in radians) by which to rotate the coordinate system. |
pivot | The pivot around which the coordinate system is to be rotated. |
tag | A tag to identify the transform. |
Definition at line 385 of file Graphics.cs.
void VectSharp.Graphics.Save | ( | ) |
Save the current transform state (rotation, translation, scale).
Definition at line 591 of file Graphics.cs.
void VectSharp.Graphics.Scale | ( | double | scaleX, |
double | scaleY, | ||
string | tag = null |
||
) |
Scale the coordinate system with respect to the origin.
scaleX | The horizontal scale. |
scaleY | The vertical scale. |
tag | A tag to identify the transform. |
Definition at line 456 of file Graphics.cs.
void VectSharp.Graphics.SetClippingPath | ( | double | leftX, |
double | topY, | ||
double | width, | ||
double | height, | ||
string | tag = null |
||
) |
Intersect the current clipping path with the specified rectangle.
leftX | The horizontal coordinate of the top-left corner of the rectangle. |
topY | The vertical coordinate of the top-left corner of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
tag | A tag to identify the clipping path. |
Definition at line 353 of file Graphics.cs.
void VectSharp.Graphics.SetClippingPath | ( | GraphicsPath | path, |
string | tag = null |
||
) |
Intersect the current clipping path with the specified GraphicsPath.
path | The GraphicsPath to intersect with the current clipping path. |
tag | A tag to identify the clipping path. |
Definition at line 340 of file Graphics.cs.
Intersect the current clipping path with the specified rectangle.
topLeft | The top-left corner of the rectangle. |
size | The size of the rectangle. |
tag | A tag to identify the clipping path. |
Definition at line 364 of file Graphics.cs.
void VectSharp.Graphics.StrokePath | ( | GraphicsPath | path, |
Brush | strokeColour, | ||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke a GraphicsPath.
path | The GraphicsPath to stroke. |
strokeColour | The Brush with which to stroke the GraphicsPath. |
lineWidth | The width of the line with which the path is stroked. |
lineCap | The line cap to use to stroke the path. |
lineJoin | The line join to use to stroke the path. |
lineDash | The line dash to use to stroke the path. |
tag | A tag to identify the stroked path. |
Definition at line 330 of file Graphics.cs.
void VectSharp.Graphics.StrokeRectangle | ( | double | leftX, |
double | topY, | ||
double | width, | ||
double | height, | ||
Brush | strokeColour, | ||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke a rectangle.
leftX | The horizontal coordinate of the top-left corner of the rectangle. |
topY | The vertical coordinate of the top-left corner of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
strokeColour | The colour with which to stroke the rectangle. |
lineWidth | The width of the line with which the rectangle is stroked. |
lineCap | The line cap to use to stroke the rectangle. |
lineJoin | The line join to use to stroke the rectangle. |
lineDash | The line dash to use to stroke the rectangle. |
tag | A tag to identify the filled rectangle. |
Definition at line 516 of file Graphics.cs.
void VectSharp.Graphics.StrokeRectangle | ( | Point | topLeft, |
Size | size, | ||
Brush | strokeColour, | ||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke a rectangle.
topLeft | The top-left corner of the rectangle. |
size | The size of the rectangle. |
strokeColour | The colour with which to stroke the rectangle. |
lineWidth | The width of the line with which the rectangle is stroked. |
lineCap | The line cap to use to stroke the rectangle. |
lineJoin | The line join to use to stroke the rectangle. |
lineDash | The line dash to use to stroke the rectangle. |
tag | A tag to identify the filled rectangle. |
Definition at line 498 of file Graphics.cs.
void VectSharp.Graphics.StrokeText | ( | double | originX, |
double | originY, | ||
IEnumerable< FormattedText > | text, | ||
Brush | strokeColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke a formatted text string.
originX | The horizontal coordinate of the text origin. |
originY | The vertical coordinate of the text origin. See textBaseline . |
text | The FormattedText to draw. |
strokeColour | The default Brush with which to stroke the text. |
lineWidth | The width of the line with which the text is stroked. |
lineCap | The line cap to use to stroke the text. |
lineJoin | The line join to use to stroke the text. |
lineDash | The line dash to use to stroke the text. |
textBaseline | The text baseline (determines what originY represents). |
tag | A tag to identify the stroked text. |
Definition at line 633 of file Graphics.Text.cs.
void VectSharp.Graphics.StrokeText | ( | double | originX, |
double | originY, | ||
string | text, | ||
Font | font, | ||
Brush | strokeColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke a text string.
originX | The horizontal coordinate of the text origin. |
originY | The vertical coordinate of the text origin. See textBaseline . |
text | The string to draw. |
font | The font with which to draw the text. |
strokeColour | The Brush with which to stroke the text. |
lineWidth | The width of the line with which the text is stroked. |
lineCap | The line cap to use to stroke the text. |
lineJoin | The line join to use to stroke the text. |
lineDash | The line dash to use to stroke the text. |
textBaseline | The text baseline (determines what originY represents). |
tag | A tag to identify the stroked text. |
Definition at line 110 of file Graphics.Text.cs.
void VectSharp.Graphics.StrokeText | ( | Point | origin, |
IEnumerable< FormattedText > | text, | ||
Brush | strokeColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke a formatted text string.
origin | The text origin. See textBaseline . |
text | The FormattedText to draw. |
strokeColour | The default Brush with which to stroke the text. |
lineWidth | The width of the line with which the text is stroked. |
lineCap | The line cap to use to stroke the text. |
lineJoin | The line join to use to stroke the text. |
lineDash | The line dash to use to stroke the text. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
tag | A tag to identify the stroked text. |
Definition at line 529 of file Graphics.Text.cs.
void VectSharp.Graphics.StrokeText | ( | Point | origin, |
string | text, | ||
Font | font, | ||
Brush | strokeColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke a text string.
origin | The text origin. See textBaseline . |
text | The string to draw. |
font | The font with which to draw the text. |
strokeColour | The Brush with which to stroke the text. |
lineWidth | The width of the line with which the text is stroked. |
lineCap | The line cap to use to stroke the text. |
lineJoin | The line join to use to stroke the text. |
lineDash | The line dash to use to stroke the text. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
tag | A tag to identify the stroked text. |
Definition at line 83 of file Graphics.Text.cs.
void VectSharp.Graphics.StrokeTextOnPath | ( | GraphicsPath | path, |
string | text, | ||
Font | font, | ||
Brush | strokeColour, | ||
double | reference = 0 , |
||
TextAnchors | anchor = TextAnchors.Left , |
||
TextBaselines | textBaseline = TextBaselines.Top , |
||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke a text string along a GraphicsPath.
path | The GraphicsPath along which the text will flow. |
text | The string to draw. |
font | The font with which to draw the text. |
strokeColour | The Brush with which to stroke the text. |
lineWidth | The width of the line with which the text is stroked. |
lineCap | The line cap to use to stroke the text. |
lineJoin | The line join to use to stroke the text. |
lineDash | The line dash to use to stroke the text. |
reference | The (relative) starting point on the path starting from which the text should be drawn (0 is the start of the path, 1 is the end of the path). |
anchor | The anchor in the text string that will correspond to the point specified by the reference . |
textBaseline | The text baseline (determines which the position of the text in relation to the path . |
tag | A tag to identify the stroked text. |
Definition at line 276 of file Graphics.Text.cs.
void VectSharp.Graphics.StrokeTextUnderline | ( | double | originX, |
double | originY, | ||
IEnumerable< FormattedText > | text, | ||
Brush | strokeColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke the underline of the specified formatted text string.
originX | The horizontal coordinate of the text origin. |
originY | The vertical coordinate of the text origin. See textBaseline . |
text | The FormattedText to draw. |
strokeColour | The default Brush with which to stroke the underline. |
lineWidth | The width of the line with which the underline is stroked. |
lineCap | The line cap to use to stroke the underline. |
lineJoin | The line join to use to stroke the underline. |
lineDash | The line dash to use to stroke the underline. |
textBaseline | The text baseline (determines what originY represents). |
tag | A tag to identify the stroked underline. |
Definition at line 874 of file Graphics.Text.cs.
void VectSharp.Graphics.StrokeTextUnderline | ( | double | originX, |
double | originY, | ||
string | text, | ||
Font | font, | ||
Brush | strokeColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke the underline of the specified text string.
originX | The horizontal coordinate of the text origin. |
originY | The vertical coordinate of the text origin. See textBaseline . |
text | The string whose underline will be drawn. |
font | The font with which to draw the text. |
strokeColour | The Brush with which to stroke the underline. |
lineWidth | The width of the line with which the underline is stroked. |
lineCap | The line cap to use to stroke the underline. |
lineJoin | The line join to use to stroke the underline. |
lineDash | The line dash to use to stroke the underline. |
textBaseline | The text baseline (determines what originY represents). |
tag | A tag to identify the stroked underline. |
Definition at line 717 of file Graphics.Text.cs.
void VectSharp.Graphics.StrokeTextUnderline | ( | Point | origin, |
IEnumerable< FormattedText > | text, | ||
Brush | strokeColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke the underline of the specified formatted text string.
origin | The text origin. See textBaseline . |
text | The FormattedText to draw. |
strokeColour | The default Brush with which to stroke the underline. |
lineWidth | The width of the line with which the underline is stroked. |
lineCap | The line cap to use to stroke the underline. |
lineJoin | The line join to use to stroke the underline. |
lineDash | The line dash to use to stroke the underline. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
tag | A tag to identify the stroked underline. |
Definition at line 891 of file Graphics.Text.cs.
void VectSharp.Graphics.StrokeTextUnderline | ( | Point | origin, |
string | text, | ||
Font | font, | ||
Brush | strokeColour, | ||
TextBaselines | textBaseline = TextBaselines.Top , |
||
double | lineWidth = 1 , |
||
LineCaps | lineCap = LineCaps.Butt , |
||
LineJoins | lineJoin = LineJoins.Miter , |
||
LineDash? | lineDash = null , |
||
string | tag = null |
||
) |
Stroke the underline of the specified text string.
origin | The text origin. See textBaseline . |
text | The string whose underline will be drawn. |
font | The font with which to draw the text. |
strokeColour | The Brush with which to stroke the underline. |
lineWidth | The width of the line with which the underline is stroked. |
lineCap | The line cap to use to stroke the underline. |
lineJoin | The line join to use to stroke the underline. |
lineDash | The line dash to use to stroke the underline. |
textBaseline | The text baseline (determines what the vertical component of origin represents). |
tag | A tag to identify the stroked underline. |
Definition at line 735 of file Graphics.Text.cs.
void VectSharp.Graphics.Transform | ( | double | a, |
double | b, | ||
double | c, | ||
double | d, | ||
double | e, | ||
double | f, | ||
string | tag = null |
||
) |
Transform the coordinate system with the specified transformation matrix [ [a, c, e], [b, d, f], [0, 0, 1] ].
a | The first element of the first column. |
b | The second element of the first column. |
c | The first element of the second column. |
d | The second element of the second column. |
e | The first element of the third column. |
f | The second element of the third column. |
tag | A tag to identify the transform. |
Definition at line 423 of file Graphics.cs.
Graphics VectSharp.Graphics.Transform | ( | Func< Point, Point > | transformationFunction, |
double | linearisationResolution | ||
) |
Creates a new Graphics object in which all the graphics actions have been transformed using an arbitrary transformation function. Raster images are replaced by grey rectangles.
transformationFunction | An arbitrary transformation function. |
linearisationResolution | The resolution that will be used to linearise curve segments. |
Definition at line 1070 of file Graphics.cs.
Graphics VectSharp.Graphics.Transform | ( | Func< Point, Point > | transformationFunction, |
double | linearisationResolution, | ||
double | maxSegmentLength | ||
) |
Creates a new Graphics object in which all the graphics actions have been transformed using an arbitrary transformation function. Raster images are replaced by grey rectangles.
transformationFunction | An arbitrary transformation function. |
linearisationResolution | The resolution that will be used to linearise curve segments. |
maxSegmentLength | The maximum length of line segments. |
Definition at line 1268 of file Graphics.cs.
void VectSharp.Graphics.Translate | ( | double | x, |
double | y, | ||
string | tag = null |
||
) |
Translate the coordinate system origin.
x | The horizontal translation. |
y | The vertical translation. |
tag | A tag to identify the transform. |
Definition at line 435 of file Graphics.cs.
void VectSharp.Graphics.Translate | ( | Point | delta, |
string | tag = null |
||
) |
Translate the coordinate system origin.
delta | The new origin point. |
tag | A tag to identify the transform. |
Definition at line 445 of file Graphics.cs.
bool VectSharp.Graphics.TryRasterise | ( | Rectangle | region, |
double | scale, | ||
bool | interpolate, | ||
out RasterImage | output | ||
) |
Tries to rasterise specified region of this Graphics object using the default rasterisation method.
region | The region of the Graphics to rasterise. |
scale | The scale at which the image is rasterised. |
interpolate | Determines whether the resulting RasterImage should be interpolated or not. |
output | When this method returns, this will contain the rasterised image (or null if the image could not be rasterised. |
true
if the image could be rasterised; false
if it could not be rasterised.Definition at line 1561 of file Graphics.cs.
|
static |
A method that is used to rasterise a region of a Graphics object. Set this to null
if you wish to use the default rasterisation methods (implemented by either VectSharp.Raster, or VectSharp.Raster.ImageSharp). You will have to provide your own implementation of this method if neither VectSharp.Raster nor VectSharp.Raster.ImageSharp are referenced by your project. The first argument of this method is the Graphics to be rasterised, the second is a Rectangle representing the region to rasterise, the third is a double representing the scale, and the third is a boolean value indicating whether the resulting RasterImage should be interpolated.
Definition at line 1551 of file Graphics.cs.
|
getset |
The default fill rule.
Definition at line 290 of file Graphics.cs.
|
staticgetset |
Determines how an unbalanced graphics state stack (which occurs if the number of calls to Save and Restore is not equal) will be treated. The default is UnbalancedStackActions.Throw.
Definition at line 283 of file Graphics.cs.
|
getset |
Determines whether unique tags should be used for graphics actions that create multiple objects (e.g. drawing text).
Definition at line 318 of file Graphics.cs.