VectSharp 2.6.1
A light library for C# vector graphics
Loading...
Searching...
No Matches
VectSharp.IGraphicsContext Interface Reference

This interface should be implemented by classes intended to provide graphics output capability to a Graphics object. More...

Public Member Functions

void Save ()
 Save the current transform state (rotation, translation, scale). This should be implemented as a LIFO stack.
 
void Restore ()
 Restore the previous transform state (rotation, translation, scale). This should be implemented as a LIFO stack.
 
void Translate (double x, double y)
 Translate the coordinate system origin. More...
 
void Rotate (double angle)
 Rotate the coordinate system around the origin. More...
 
void Scale (double scaleX, double scaleY)
 Scale the coordinate system with respect to the origin. More...
 
void Transform (double a, double b, double c, double d, double e, double f)
 Transform the coordinate system with the specified transformation matrix [ [a, c, e], [b, d, f], [0, 0, 1] ]. More...
 
void FillText (string text, double x, double y)
 Fill a text string using the current Font and TextBaseline. More...
 
void StrokeText (string text, double x, double y)
 Stroke the outline of a text string using the current Font and TextBaseline. More...
 
void MoveTo (double x, double y)
 Change the current point without drawing a line from the previous point. If necessary, start a new figure. More...
 
void LineTo (double x, double y)
 Draw a line from the previous point to the specified point. More...
 
void Close ()
 Close the current figure.
 
void Stroke ()
 Stroke the current path using the current StrokeStyle, LineWidth, LineCap, LineJoin and LineDash.
 
void SetClippingPath ()
 Set the current clipping path as the intersection of the previous clipping path and the current path.
 
void SetFillStyle ((int r, int g, int b, double a) style)
 Set the current FillStyle. More...
 
void SetFillStyle (Brush style)
 Set the current FillStyle. More...
 
void SetStrokeStyle ((int r, int g, int b, double a) style)
 Set the current StrokeStyle. More...
 
void SetStrokeStyle (Brush style)
 Set the current StrokeStyle. More...
 
void CubicBezierTo (double p1X, double p1Y, double p2X, double p2Y, double p3X, double p3Y)
 Add to the current figure a cubic Bezier from the current point to a destination point, with two control points. More...
 
void Rectangle (double x0, double y0, double width, double height)
 Add a rectangle figure to the current path. More...
 
void Fill (FillRule fillRule)
 Fill the current path using the current FillStyle. More...
 
void SetLineDash (LineDash dash)
 Set the current line dash pattern. More...
 
void DrawRasterImage (int sourceX, int sourceY, int sourceWidth, int sourceHeight, double destinationX, double destinationY, double destinationWidth, double destinationHeight, RasterImage image)
 Draw a raster image. More...
 
void DrawFilteredGraphics (Graphics graphics, IFilter filter)
 Draws a Graphics object, applying the specified filter . More...
 

Properties

double Width [get]
 Width of the graphic surface. More...
 
double Height [get]
 Height of the graphic surface. More...
 
Font Font [get, set]
 The current font. More...
 
TextBaselines TextBaseline [get, set]
 The current text baseline. More...
 
Brush FillStyle [get]
 Current brush used to fill paths. More...
 
Brush StrokeStyle [get]
 Current brush used to stroke paths. More...
 
double LineWidth [get, set]
 Current line width used to stroke paths. More...
 
LineCaps LineCap [set]
 Current line cap used to stroke paths. More...
 
LineJoins LineJoin [set]
 Current line join used to stroke paths. More...
 
string Tag [get, set]
 The current tag. How this can be used depends on each implementation. More...
 

Detailed Description

This interface should be implemented by classes intended to provide graphics output capability to a Graphics object.

Definition at line 36 of file Graphics.cs.

Member Function Documentation

◆ CubicBezierTo()

void VectSharp.IGraphicsContext.CubicBezierTo ( double  p1X,
double  p1Y,
double  p2X,
double  p2Y,
double  p3X,
double  p3Y 
)

Add to the current figure a cubic Bezier from the current point to a destination point, with two control points.

Parameters
p1XThe horizontal coordinate of the first control point.
p1YThe vertical coordinate of the first control point.
p2XThe horizontal coordinate of the second control point.
p2YThe vertical coordinate of the second control point.
p3XThe horizontal coordinate of the destination point.
p3YThe vertical coordinate of the destination point.

◆ DrawFilteredGraphics()

void VectSharp.IGraphicsContext.DrawFilteredGraphics ( Graphics  graphics,
IFilter  filter 
)

Draws a Graphics object, applying the specified filter .

Parameters
graphicsThe Graphics object to draw on the current Graphics object.
filterAn IFilter object, representing the filter to apply to the graphics object.

◆ DrawRasterImage()

void VectSharp.IGraphicsContext.DrawRasterImage ( int  sourceX,
int  sourceY,
int  sourceWidth,
int  sourceHeight,
double  destinationX,
double  destinationY,
double  destinationWidth,
double  destinationHeight,
RasterImage  image 
)

Draw a raster image.

Parameters
sourceXThe horizontal coordinate of the top-left corner of the rectangle delimiting the source area of the image.
sourceYThe vertical coordinate of the top-left corner of the rectangle delimiting the source area of the image.
sourceWidthThe width of the rectangle delimiting the source area of the image.
sourceHeightThe height of the rectangle delimiting the source area of the image.
destinationXThe horizontal coordinate of the top-left corner of the rectangle delimiting the destination area of the image.
destinationYThe vertical coordinate of the top-left corner of the rectangle delimiting the destination area of the image.
destinationWidthThe width of the rectangle delimiting the destination area of the image.
destinationHeightThe height of the rectangle delimiting the destination area of the image.
imageThe image to draw.

◆ Fill()

void VectSharp.IGraphicsContext.Fill ( FillRule  fillRule)

Fill the current path using the current FillStyle.

Parameters
fillRuleThe FillRule that determines which parts of the path are filled.

◆ FillText()

void VectSharp.IGraphicsContext.FillText ( string  text,
double  x,
double  y 
)

Fill a text string using the current Font and TextBaseline.

Parameters
textThe string to draw.
xThe horizontal coordinate of the text origin.
yThe vertical coordinate of the text origin.

◆ LineTo()

void VectSharp.IGraphicsContext.LineTo ( double  x,
double  y 
)

Draw a line from the previous point to the specified point.

Parameters
xThe horizontal coordinate of the point.
yThe vertical coordinate of the point.

◆ MoveTo()

void VectSharp.IGraphicsContext.MoveTo ( double  x,
double  y 
)

Change the current point without drawing a line from the previous point. If necessary, start a new figure.

Parameters
xThe horizontal coordinate of the point.
yThe vertical coordinate of the point.

◆ Rectangle()

void VectSharp.IGraphicsContext.Rectangle ( double  x0,
double  y0,
double  width,
double  height 
)

Add a rectangle figure to the current path.

Parameters
x0The horizontal coordinate of the top-left corner of the rectangle.
y0The vertical coordinate of the top-left corner of the rectangle.
widthThe width of corner of the rectangle.
heightThe height of corner of the rectangle.

◆ Rotate()

void VectSharp.IGraphicsContext.Rotate ( double  angle)

Rotate the coordinate system around the origin.

Parameters
angleThe angle (in radians) by which to rotate the coordinate system.

◆ Scale()

void VectSharp.IGraphicsContext.Scale ( double  scaleX,
double  scaleY 
)

Scale the coordinate system with respect to the origin.

Parameters
scaleXThe horizontal scale.
scaleYThe vertical scale.

◆ SetFillStyle() [1/2]

void VectSharp.IGraphicsContext.SetFillStyle ( (int r, int g, int b, double a)  style)

Set the current FillStyle.

Parameters
styleA ValueTuple<Int32, Int32, Int32, Double> containing component information for the colour. For r, g, and b, range: [0, 255]; for a, range: [0, 1].

◆ SetFillStyle() [2/2]

void VectSharp.IGraphicsContext.SetFillStyle ( Brush  style)

Set the current FillStyle.

Parameters
styleThe new fill style.

◆ SetLineDash()

void VectSharp.IGraphicsContext.SetLineDash ( LineDash  dash)

Set the current line dash pattern.

Parameters
dashThe line dash pattern.

◆ SetStrokeStyle() [1/2]

void VectSharp.IGraphicsContext.SetStrokeStyle ( (int r, int g, int b, double a)  style)

Set the current StrokeStyle.

Parameters
styleA ValueTuple<Int32, Int32, Int32, Double> containing component information for the colour. For r, g, and b, range: [0, 255]; for a, range: [0, 1].

◆ SetStrokeStyle() [2/2]

void VectSharp.IGraphicsContext.SetStrokeStyle ( Brush  style)

Set the current StrokeStyle.

Parameters
styleThe new stroke style.

◆ StrokeText()

void VectSharp.IGraphicsContext.StrokeText ( string  text,
double  x,
double  y 
)

Stroke the outline of a text string using the current Font and TextBaseline.

Parameters
textThe string to draw.
xThe horizontal coordinate of the text origin.
yThe vertical coordinate of the text origin.

◆ Transform()

void VectSharp.IGraphicsContext.Transform ( double  a,
double  b,
double  c,
double  d,
double  e,
double  f 
)

Transform the coordinate system with the specified transformation matrix [ [a, c, e], [b, d, f], [0, 0, 1] ].

Parameters
aThe first element of the first column.
bThe second element of the first column.
cThe first element of the second column.
dThe second element of the second column.
eThe first element of the third column.
fThe second element of the third column.

◆ Translate()

void VectSharp.IGraphicsContext.Translate ( double  x,
double  y 
)

Translate the coordinate system origin.

Parameters
xThe horizontal translation.
yThe vertical translation.

Property Documentation

◆ FillStyle

Brush VectSharp.IGraphicsContext.FillStyle
get

Current brush used to fill paths.

Definition at line 147 of file Graphics.cs.

◆ Font

Font VectSharp.IGraphicsContext.Font
getset

The current font.

Definition at line 92 of file Graphics.cs.

◆ Height

double VectSharp.IGraphicsContext.Height
get

Height of the graphic surface.

Definition at line 46 of file Graphics.cs.

◆ LineCap

LineCaps VectSharp.IGraphicsContext.LineCap
set

Current line cap used to stroke paths.

Definition at line 212 of file Graphics.cs.

◆ LineJoin

LineJoins VectSharp.IGraphicsContext.LineJoin
set

Current line join used to stroke paths.

Definition at line 217 of file Graphics.cs.

◆ LineWidth

double VectSharp.IGraphicsContext.LineWidth
getset

Current line width used to stroke paths.

Definition at line 207 of file Graphics.cs.

◆ StrokeStyle

Brush VectSharp.IGraphicsContext.StrokeStyle
get

Current brush used to stroke paths.

Definition at line 164 of file Graphics.cs.

◆ Tag

string VectSharp.IGraphicsContext.Tag
getset

The current tag. How this can be used depends on each implementation.

Definition at line 228 of file Graphics.cs.

◆ TextBaseline

TextBaselines VectSharp.IGraphicsContext.TextBaseline
getset

The current text baseline.

Definition at line 97 of file Graphics.cs.

◆ Width

double VectSharp.IGraphicsContext.Width
get

Width of the graphic surface.

Definition at line 41 of file Graphics.cs.


The documentation for this interface was generated from the following file: