[]
        
(Showing Draft Content)

GrapeCity.Documents.Drawing.GcGraphics

Class GcGraphics

Namespace
GrapeCity.Documents.Drawing
Assembly
GcDocs.Imaging.dll

Abstract base class that implements a drawing surface.

public abstract class GcGraphics : IDisposable
Inheritance
object
GcGraphics
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

GcGraphics()

Initializes a new instance of the GcGraphics class.

public GcGraphics()

Properties

BlendMode

Gets or sets the current blend mode.

public BlendMode BlendMode { get; set; }

Property Value

BlendMode

Disposed

Gets a value indicating whether this instance of GcGraphics has been disposed and cannot be used anymore.

public bool Disposed { get; }

Property Value

bool

DrawTextAsPath

Gets or sets a value indicating if strings and TextLayout objects are rendered using the graphic primitives instead of the specialized text drawing services.

public bool DrawTextAsPath { get; set; }

Property Value

bool

FontCollection

Gets or sets a FontCollection used by MeasureString and DrawString methods.

public FontCollection FontCollection { get; set; }

Property Value

FontCollection
See Also

InterpolationMode

Gets or sets the sampling mode to use when drawing images with resizing.

public InterpolationMode InterpolationMode { get; set; }

Property Value

InterpolationMode

Resolution

Gets or sets the resolution of the current graphics (pixels per inch).

public abstract float Resolution { get; set; }

Property Value

float

SurfaceResolution

Gets the resolution of the underlying drawing surface (pixels per inch).

public virtual float? SurfaceResolution { get; }

Property Value

float?

Transform

Gets or sets the transformation matrix of the current graphics.

public abstract Matrix3x2 Transform { get; set; }

Property Value

System.Numerics.Matrix3x2

Methods

CheckDisposed()

Checks whether object was disposed and throws an exception in this case.

protected void CheckDisposed()

CreateClipRegion(IPath)

Creates a clip region from a graphics path.

Use PushClip(IClipRegion) and PopClip(IClipRegion) to set/remove clipping.

public IClipRegion CreateClipRegion(IPath graphicsPath)

Parameters

graphicsPath IPath

The path to create the clip region from.

Returns

IClipRegion

The created clip region.

CreateClipRegion(RectangleF)

Creates a clip region from a rectangle.

public IClipRegion CreateClipRegion(RectangleF bounds)

Parameters

bounds System.Drawing.RectangleF

The rectangle to create the clip region from.

Returns

IClipRegion

The created clip region.

CreatePath()

Creates a graphics path.

public IPath CreatePath()

Returns

IPath

The created path.

CreateRoundBordersPath(RectangleF, CornerRadius)

Creates IPath object representing round border.

public IPath CreateRoundBordersPath(RectangleF bounds, CornerRadius cornerRadius)

Parameters

bounds System.Drawing.RectangleF

The border bounds.

cornerRadius CornerRadius

The CornerRadius structure.

Returns

IPath

The IPath representing round border.

CreateTextLayout()

Creates an instance of TextLayout with the same resolution as that of the current graphics.

This is the recommended way to create a TextLayout to use with a graphics.

public TextLayout CreateTextLayout()

Returns

TextLayout

The newly created text layout.

See Also

Dispose()

Releases all resources used by the current GcGraphics.

public void Dispose()

Dispose(bool)

Disposes the current graphics.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

DrawEllipse(RectangleF, Pen)

Draws an ellipse using a specified pen.

public void DrawEllipse(RectangleF bounds, Pen pen)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that specifies the ellipse to draw.

pen Pen

The pen used to draw the ellipse.

DrawEllipse(RectangleF, Color, float, DashStyle)

Draws an ellipse using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the ellipse is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawEllipse(RectangleF bounds, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that specifies the ellipse to draw.

lineColor System.Drawing.Color

The color of lines used to draw the ellipse.

lineWidth float

The width of lines used to draw the ellipse.

lineStyle DashStyle

The line style (solid by default).

DrawEllipse(RectangleF, Color, float, float[])

Draws an ellipse using a specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the ellipse is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawEllipse(RectangleF bounds, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that specifies the ellipse to draw.

lineColor System.Drawing.Color

The color of lines used to draw the ellipse.

lineWidth float

The width of lines used to draw the ellipse.

dashPattern float[]

The dash pattern of lines used to draw the ellipse.

DrawImage(IImage, RectangleF, RectangleF?, ImageAlign, out RectangleF[], float)

Draws an image using specified bounds, clipping and image alignment.

In an output parameter, returns the array of actual image bounds.

public void DrawImage(IImage image, RectangleF destBounds, RectangleF? clipBounds, ImageAlign align, out RectangleF[] imageBounds, float opacity = 1)

Parameters

image IImage

The image to draw.

destBounds System.Drawing.RectangleF

The destination rectangle.

clipBounds System.Drawing.RectangleF?

The clipping rectangle, or null for no clipping.

align ImageAlign

The image alignment.

imageBounds System.Drawing.RectangleF[]

OUT: The actual bounds of the drawn images (can be more than one if the image is tiled).

opacity float

The image opacity.

DrawImage(IImage, RectangleF, RectangleF?, ImageAlign, float)

Draws an image using specified bounds, clipping and image alignment.

public void DrawImage(IImage image, RectangleF destBounds, RectangleF? clipBounds, ImageAlign align, float opacity = 1)

Parameters

image IImage

The image to draw.

destBounds System.Drawing.RectangleF

The destination rectangle.

clipBounds System.Drawing.RectangleF?

The clipping rectangle, or null for no clipping.

align ImageAlign

The image alignment.

opacity float

The image opacity.

DrawLine(PointF, PointF, Pen)

Draws a line between two points, using the specified pen.

public void DrawLine(PointF p1, PointF p2, Pen pen)

Parameters

p1 System.Drawing.PointF

The first point.

p2 System.Drawing.PointF

The second point.

pen Pen

The pen to use.

DrawLine(PointF, PointF, Color, float, DashStyle)

Draws a line between two points, using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the line is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawLine(PointF p1, PointF p2, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

p1 System.Drawing.PointF

The first point.

p2 System.Drawing.PointF

The second point.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

lineStyle DashStyle

The line style (solid by default).

DrawLine(PointF, PointF, Color, float, float[])

Draws a line between two points, using the specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the line is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawLine(PointF p1, PointF p2, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

p1 System.Drawing.PointF

The first point.

p2 System.Drawing.PointF

The second point.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

dashPattern float[]

The dash pattern.

DrawLine(float, float, float, float, Pen)

Draws a line between two points, using the specified pen.

public void DrawLine(float x1, float y1, float x2, float y2, Pen pen)

Parameters

x1 float

The X coordinate of the first point.

y1 float

The Y coordinate of the first point.

x2 float

The X coordinate of the second point.

y2 float

The Y coordinate of the second point.

pen Pen

The pen to use.

DrawLine(float, float, float, float, Color, float, DashStyle)

Draws a line between two points, using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the line is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawLine(float x1, float y1, float x2, float y2, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

x1 float

The X coordinate of the first point.

y1 float

The Y coordinate of the first point.

x2 float

The X coordinate of the second point.

y2 float

The Y coordinate of the second point.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

lineStyle DashStyle

The line style (solid by default).

DrawLine(float, float, float, float, Color, float, float[])

Draws a line between two points, using the specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the line is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawLine(float x1, float y1, float x2, float y2, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

x1 float

The X coordinate of the first point.

y1 float

The Y coordinate of the first point.

x2 float

The X coordinate of the second point.

y2 float

The Y coordinate of the second point.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

dashPattern float[]

The dash pattern.

DrawLines(PointF[], Pen)

Draws a series of connected lines, using a specified pen.

public void DrawLines(PointF[] points, Pen pen)

Parameters

points System.Drawing.PointF[]

The array of points to connect.

pen Pen

The pen to use.

DrawLines(PointF[], Color, float, DashStyle)

Draws a series of connected lines, using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the lines are drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawLines(PointF[] points, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

points System.Drawing.PointF[]

The array of points to connect.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

lineStyle DashStyle

The line style (solid by default).

DrawLines(PointF[], Color, float, float[])

Draws a series of connected lines, using a specified line style.

If the dashPattern array contains two or more items, the lines are drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawLines(PointF[] points, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

points System.Drawing.PointF[]

The array of points to connect.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

dashPattern float[]

The dash pattern.

DrawPath(IPath, Pen)

Draws a path using a specified pen.

public void DrawPath(IPath path, Pen pen)

Parameters

path IPath

An object implementing the IPath interface that represents the path to draw.

pen Pen

The pen used to draw the path.

DrawPath(IPath, Color, float, DashStyle)

Draws a path using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the path is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawPath(IPath path, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

path IPath

An object implementing the IPath interface that represents the path to draw.

lineColor System.Drawing.Color

The color of lines used to draw the path.

lineWidth float

The width of lines used to draw the path.

lineStyle DashStyle

The style of lines used to draw the path (solid by default).

DrawPath(IPath, Color, float, float[])

Draws a path using a specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the path is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawPath(IPath path, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

path IPath

An object implementing the IPath interface that represents the path to draw.

lineColor System.Drawing.Color

The color of lines used to draw the path.

lineWidth float

The width of lines used to draw the path.

dashPattern float[]

The dash pattern of lines used to draw the path.

DrawPolygon(Quadrilateral, Pen)

Draws a polygon specified by an array of points, using a specified pen.

public void DrawPolygon(Quadrilateral quadrilateral, Pen pen)

Parameters

quadrilateral Quadrilateral

A quadrilateral specifying the polygon.

pen Pen

The pen to use.

DrawPolygon(Quadrilateral, Color, float, DashStyle)

Draws a polygon specified by an array of points, using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the polygon is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawPolygon(Quadrilateral quadrilateral, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

quadrilateral Quadrilateral

A quadrilateral specifying the polygon.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

lineStyle DashStyle

The line style (solid by default).

DrawPolygon(Quadrilateral, Color, float, float[])

Draws a polygon specified by an array of points, using a specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the polygon is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawPolygon(Quadrilateral quadrilateral, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

quadrilateral Quadrilateral

A quadrilateral specifying the polygon.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

dashPattern float[]

The dash pattern.

DrawPolygon(PointF[], Pen)

Draws a polygon specified by an array of points, using a specified pen.

public void DrawPolygon(PointF[] points, Pen pen)

Parameters

points System.Drawing.PointF[]

An array of points specifying the polygon.

pen Pen

The pen to use.

DrawPolygon(PointF[], Color, float, DashStyle)

Draws a polygon specified by an array of points, using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the polygon is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawPolygon(PointF[] points, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

points System.Drawing.PointF[]

An array of points specifying the polygon.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

lineStyle DashStyle

The line style (solid by default).

DrawPolygon(PointF[], Color, float, float[])

Draws a polygon specified by an array of points, using a specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the polygon is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawPolygon(PointF[] points, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

points System.Drawing.PointF[]

An array of points specifying the polygon.

lineColor System.Drawing.Color

The line color.

lineWidth float

The line width.

dashPattern float[]

The dash pattern.

DrawRectangle(RectangleF, Pen)

Draws a rectangle using a specified pen.

public void DrawRectangle(RectangleF bounds, Pen pen)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to draw.

pen Pen

The pen used to draw the rectangle.

DrawRectangle(RectangleF, Color, float, DashStyle)

Draws a rectangle using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the rectangle is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawRectangle(RectangleF bounds, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to draw.

lineColor System.Drawing.Color

The color of lines used to draw the rectangle.

lineWidth float

The width of lines used to draw the rectangle.

lineStyle DashStyle

The style of lines used to draw the rectangle (solid by default).

DrawRectangle(RectangleF, Color, float, float[])

Draws a rectangle using a specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the rectangle is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawRectangle(RectangleF bounds, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to draw.

lineColor System.Drawing.Color

The color of lines used to draw the rectangle.

lineWidth float

The width of lines used to draw the rectangle.

dashPattern float[]

The dash pattern lines used to draw the rectangle.

DrawRotatedText(TextLayout, int, bool, RectangleF, RotatedTextAlignment)

Draws rotated text inside an unrotated rectangle.

Note that the original textLayout will be changed by this method. If necessary, create a clone in advance.

Also note that the values of the following properties are ignored: MaxWidth, MaxHeight, FlowDirection, CanSkipFirstLineWithIndentation, ObjectRects, ParagraphAlignment, MarginLeft, MarginRight, MarginTop, MarginBottom, ColumnWidth, RowHeight.

public void DrawRotatedText(TextLayout textLayout, int angle, bool verticalStacking, RectangleF rect, RotatedTextAlignment alignment)

Parameters

textLayout TextLayout

The TextLayout to draw.

angle int

The text rotation angle, in degrees. The expected range is [-90, +90].

verticalStacking bool

If false, text lines are stacked horizontally along the top and bottom sides of rect. If true, the lines are stacked vertically along the left and right sides of the rectangle.

rect System.Drawing.RectangleF

The target rectangle for the text.

alignment RotatedTextAlignment

Alignment of the text in the target rectangle.

DrawRoundRect(RectangleF, Pen, Pen, Pen, Pen, CornerRadius)

Draws a rounded border defined by four Pen objects and CornerRadius structure.

public void DrawRoundRect(RectangleF bounds, Pen left, Pen top, Pen right, Pen bottom, CornerRadius cornerRadius)

Parameters

bounds System.Drawing.RectangleF

The System.Drawing.RectangleF structure that represents the border bounds.

left Pen

The left border.

top Pen

The top border.

right Pen

The right border.

bottom Pen

The bottom border.

cornerRadius CornerRadius

The border's corner radius.

DrawRoundRect(RectangleF, float, Pen)

Draws a rounded rectangle using a specified pen.

public void DrawRoundRect(RectangleF bounds, float radius, Pen pen)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to draw.

radius float

The radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

pen Pen

The pen used to draw the rounded rectangle.

DrawRoundRect(RectangleF, float, Color, float, DashStyle)

Draws a rounded rectangle using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the rounded rectangle is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawRoundRect(RectangleF bounds, float radius, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to draw.

radius float

The radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

lineColor System.Drawing.Color

The color of lines used to draw the rounded rectangle.

lineWidth float

The width of lines used to draw the rounded rectangle.

lineStyle DashStyle

The style of lines used to draw the rounded rectangle (solid by default).

DrawRoundRect(RectangleF, float, Color, float, float[])

Draws a rounded rectangle using a specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the rounded rectangle is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawRoundRect(RectangleF bounds, float radius, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to draw.

radius float

The radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

lineColor System.Drawing.Color

The color of lines used to draw the rounded rectangle.

lineWidth float

The width of lines used to draw the rounded rectangle.

dashPattern float[]

The dash pattern lines used to draw the rounded rectangle.

DrawRoundRect(RectangleF, float, float, Pen)

Draws a rounded rectangle using a specified pen.

public void DrawRoundRect(RectangleF bounds, float radiusX, float radiusY, Pen pen)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to draw.

radiusX float

The x-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

radiusY float

The y-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

pen Pen

The pen used to draw the rounded rectangle.

DrawRoundRect(RectangleF, float, float, Color, float, DashStyle)

Draws a rounded rectangle using a specified line color, width and style.

If the value of lineStyle parameter is not Solid, the rounded rectangle is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawRoundRect(RectangleF bounds, float radiusX, float radiusY, Color lineColor, float lineWidth, DashStyle lineStyle = DashStyle.Solid)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to draw.

radiusX float

The x-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

radiusY float

The y-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

lineColor System.Drawing.Color

The color of lines used to draw the rounded rectangle.

lineWidth float

The width of lines used to draw the rounded rectangle.

lineStyle DashStyle

The style of lines used to draw the rounded rectangle (solid by default).

DrawRoundRect(RectangleF, float, float, Color, float, float[])

Draws a rounded rectangle using a specified line color, width and dash pattern.

If the dashPattern array contains two or more items, the rounded rectangle is drawn with a Pen having LineCap set to Square instead of Flat.

public void DrawRoundRect(RectangleF bounds, float radiusX, float radiusY, Color lineColor, float lineWidth, float[] dashPattern)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to draw.

radiusX float

The x-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

radiusY float

The y-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

lineColor System.Drawing.Color

The color of lines used to draw the rounded rectangle.

lineWidth float

The width of lines used to draw the rounded rectangle.

dashPattern float[]

The dash pattern lines used to draw the rounded rectangle.

DrawSlantedText(TextLayout, int, bool, RectangleF, SlantedTextAlignment)

Draws rotated text inside a slanted rectangle.

Note that the original textLayout will be changed by this method. If necessary, create a clone in advance.

Also note that the values of the following properties are ignored: MaxWidth, MaxHeight, FlowDirection, CanSkipFirstLineWithIndentation, ObjectRects, ParagraphAlignment, MarginLeft, MarginRight, MarginTop, MarginBottom, ColumnWidth, RowHeight.

public void DrawSlantedText(TextLayout textLayout, int angle, bool verticalStacking, RectangleF rect, SlantedTextAlignment alignment)

Parameters

textLayout TextLayout

The TextLayout to draw.

angle int

The text rotation angle, in degrees. The expected range is [-90, +90].

verticalStacking bool

If false, text lines are stacked horizontally along the top and bottom sides of rect. If true, the lines are stacked vertically along the left and right sides of the rectangle.

rect System.Drawing.RectangleF

The target rectangle to be slanted with text.

alignment SlantedTextAlignment

Alignment of the text in the slanted rectangle.

DrawString(string, Font, float, Color, PointF)

Draws a string using a specified attributes at a specified location.

public void DrawString(string text, Font font, float fontSize, Color foreColor, PointF location)

Parameters

text string

The string to draw.

font Font

The font.

fontSize float

The font size.

foreColor System.Drawing.Color

The text color.

location System.Drawing.PointF

The location to draw at.

DrawString(string, TextFormat, PointF)

Draws a string using a specified TextFormat at a specified location.

public void DrawString(string text, TextFormat textFormat, PointF location)

Parameters

text string

The string to draw.

textFormat TextFormat

The text format to use.

location System.Drawing.PointF

The location to draw at.

DrawString(string, TextFormat, RectangleF, TextAlignment, ParagraphAlignment, bool)

Draws a string using a specified TextFormat within a rectangle using a specified text alignment, paragraph alignment and word wrapping flag.

public void DrawString(string text, TextFormat textFormat, RectangleF rect, TextAlignment textAlignment = TextAlignment.Leading, ParagraphAlignment paragraphAlignment = ParagraphAlignment.Near, bool wordWrap = true)

Parameters

text string

The string to draw.

textFormat TextFormat

The text format to use.

rect System.Drawing.RectangleF

The target rectangle.

textAlignment TextAlignment

The text alignment (Leading by default).

paragraphAlignment ParagraphAlignment

The paragraph alignment (Near by default).

wordWrap bool

Whether to use word wrapping (true by default).

DrawSvg(GcSvgDocument, PointF, float)

Draws a specified SVG document at a point specifying the position of the SVG viewport.

To specify the position of the SVG content rather than viewport, see DrawSvgContent(GcSvgDocument, PointF, float).

public void DrawSvg(GcSvgDocument svgDocument, PointF viewportPosition, float opacity = 1)

Parameters

svgDocument GcSvgDocument

The SVG document to draw.

viewportPosition System.Drawing.PointF

The coordinates for drawing the top-left corner of the SVG viewport.

opacity float

The opacity factor to be applied to the SVG content.

DrawSvg(GcSvgDocument, RectangleF, float)

Draws a specified SVG document, resizing its viewport to fit into a specified rectangle.

To draw just the content of the SVG ignoring viewport position, see DrawSvgContent(GcSvgDocument, RectangleF, float).

public void DrawSvg(GcSvgDocument svgDocument, RectangleF viewportRect, float opacity = 1)

Parameters

svgDocument GcSvgDocument

The SVG document to draw.

viewportRect System.Drawing.RectangleF

The target rectangle for the SVG viewport.

opacity float

The opacity factor to be applied to the SVG content.

DrawSvgContent(GcSvgDocument, PointF, float)

Draws the content of a specified SVG document at a point specifying the top-left corner of the SVG content.

To specify the position of the SVG viewport rather than content, see DrawSvg(GcSvgDocument, PointF, float).

public void DrawSvgContent(GcSvgDocument svgDocument, PointF contentPosition, float opacity = 1)

Parameters

svgDocument GcSvgDocument

The SVG document to draw.

contentPosition System.Drawing.PointF

The coordinates for the top-left corner of the SVG content.

opacity float

The opacity factor to be applied to the SVG content.

DrawSvgContent(GcSvgDocument, RectangleF, float)

Draws the content of a specified SVG document, resizing the content to fit into a specified rectangle.

To draw the SVG resizing its viewport rather than just the content, see DrawSvg(GcSvgDocument, RectangleF, float).

public void DrawSvgContent(GcSvgDocument svgDocument, RectangleF contentRect, float opacity = 1)

Parameters

svgDocument GcSvgDocument

The SVG document to draw.

contentRect System.Drawing.RectangleF

The target rectangle for the SVG content.

opacity float

The opacity factor to be applied to the SVG content.

DrawTextLayout(TextLayout, PointF)

Draws a TextLayout at a specified location.

If any part of the text does not fit in the layout bounds, it is truncated.

public void DrawTextLayout(TextLayout layout, PointF location)

Parameters

layout TextLayout

The TextLayout to draw.

location System.Drawing.PointF

The location at which to draw the layout.

FillEllipse(RectangleF, Brush, RectangleF?, Matrix3x2?)

Fills an ellipse with a specified brush.

public void FillEllipse(RectangleF bounds, Brush brush, RectangleF? brushBounds = null, Matrix3x2? brushTransform = null)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that specifies the ellipse to fill.

brush Brush

The fill brush.

brushBounds System.Drawing.RectangleF?

The optional bounds for a gradient brush.

brushTransform System.Numerics.Matrix3x2?

The transformation applied to the brush.

FillEllipse(RectangleF, Color)

Fills an ellipse with a specified solid color.

public void FillEllipse(RectangleF bounds, Color color)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that specifies the ellipse to fill.

color System.Drawing.Color

The fill color.

FillPath(IPath, Brush, RectangleF?, Matrix3x2?)

Fills a path using a specified brush.

public void FillPath(IPath path, Brush brush, RectangleF? brushBounds = null, Matrix3x2? brushTransform = null)

Parameters

path IPath

An object implementing the IPath interface that represents the path to fill.

brush Brush

The brush used to fill the path.

brushBounds System.Drawing.RectangleF?

The optional bounds for a gradient brush.

brushTransform System.Numerics.Matrix3x2?

The transformation applied to the brush.

FillPath(IPath, Color)

Fills a path using a specified color.

public void FillPath(IPath path, Color color)

Parameters

path IPath

An object implementing the IPath interface that represents the path to fill.

color System.Drawing.Color

The color used to fill the path.

FillPolygon(Quadrilateral, Brush, RectangleF?, Matrix3x2?)

Fills a polygon specified by an array of points, using a specified brush and fill mode.

public void FillPolygon(Quadrilateral quadrilateral, Brush brush, RectangleF? brushBounds = null, Matrix3x2? brushTransform = null)

Parameters

quadrilateral Quadrilateral

A quadrilateral specifying the polygon.

brush Brush

The fill brush.

brushBounds System.Drawing.RectangleF?

The optional bounds for a gradient brush.

brushTransform System.Numerics.Matrix3x2?

The transformation applied to the brush.

FillPolygon(Quadrilateral, Color)

Fills a polygon specified by an array of points, using a specified color and fill mode.

public void FillPolygon(Quadrilateral quadrilateral, Color color)

Parameters

quadrilateral Quadrilateral

A quadrilateral specifying the polygon.

color System.Drawing.Color

The fill color.

FillPolygon(PointF[], Brush, FillMode, RectangleF?, Matrix3x2?)

Fills a polygon specified by an array of points, using a specified brush and fill mode.

public void FillPolygon(PointF[] points, Brush brush, FillMode fillMode = FillMode.Alternate, RectangleF? brushBounds = null, Matrix3x2? brushTransform = null)

Parameters

points System.Drawing.PointF[]

An array of points specifying the polygon.

brush Brush

The fill brush.

fillMode FillMode

The fill mode (alternate by default).

brushBounds System.Drawing.RectangleF?

The optional bounds for a gradient brush.

brushTransform System.Numerics.Matrix3x2?

The transformation applied to the brush.

FillPolygon(PointF[], Color, FillMode)

Fills a polygon specified by an array of points, using a specified color and fill mode.

public void FillPolygon(PointF[] points, Color color, FillMode fillMode = FillMode.Alternate)

Parameters

points System.Drawing.PointF[]

An array of points specifying the polygon.

color System.Drawing.Color

The fill color.

fillMode FillMode

The fill mode (alternate by default).

FillRectangle(RectangleF, Brush, RectangleF?, Matrix3x2?)

Fills a rectangle using a specified brush.

public void FillRectangle(RectangleF bounds, Brush brush, RectangleF? brushBounds = null, Matrix3x2? brushTransform = null)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to fill.

brush Brush

The brush to use.

brushBounds System.Drawing.RectangleF?

The optional bounds for a gradient brush.

brushTransform System.Numerics.Matrix3x2?

The transformation applied to the brush.

FillRectangle(RectangleF, Color)

Fills a rectangle with a solid color.

public void FillRectangle(RectangleF bounds, Color color)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to fill.

color System.Drawing.Color

The fill color.

FillRoundRect(RectangleF, float, Brush, RectangleF?, Matrix3x2?)

Fills a rounded rectangle using a specified brush.

public void FillRoundRect(RectangleF bounds, float radius, Brush brush, RectangleF? brushBounds = null, Matrix3x2? brushTransform = null)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to fill.

radius float

The radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

brush Brush

The brush to use.

brushBounds System.Drawing.RectangleF?

The optional bounds for a gradient brush.

brushTransform System.Numerics.Matrix3x2?

The transformation applied to the brush.

FillRoundRect(RectangleF, float, Color)

Fills a rounded rectangle witih a solid color.

public void FillRoundRect(RectangleF bounds, float radius, Color color)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to fill.

radius float

The radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

color System.Drawing.Color

The fill color.

FillRoundRect(RectangleF, float, float, Brush, RectangleF?, Matrix3x2?)

Fills a rounded rectangle using a specified brush.

public void FillRoundRect(RectangleF bounds, float radiusX, float radiusY, Brush brush, RectangleF? brushBounds = null, Matrix3x2? brushTransform = null)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to fill.

radiusX float

The x-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

radiusY float

The y-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

brush Brush

The brush to use.

brushBounds System.Drawing.RectangleF?

The optional bounds for a gradient brush.

brushTransform System.Numerics.Matrix3x2?

The transformation applied to the brush.

FillRoundRect(RectangleF, float, float, Color)

Fills a rounded rectangle witih a solid color.

public void FillRoundRect(RectangleF bounds, float radiusX, float radiusY, Color color)

Parameters

bounds System.Drawing.RectangleF

A System.Drawing.RectangleF structure that represents the rectangle to fill.

radiusX float

The x-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

radiusY float

The y-radius for the quarter ellipse that is drawn to replace every corner of the rectangle.

color System.Drawing.Color

The fill color.

~GcGraphics()

Destroys the current instance.

protected ~GcGraphics()

GetBlendMode()

For internal use. Returns the current blend mode.

protected virtual BlendMode GetBlendMode()

Returns

BlendMode

GetImageSize(IImage)

Returns the size of an image in pixels using the resolution of the current graphics.

public SizeF GetImageSize(IImage image)

Parameters

image IImage

The image to get the size of.

Returns

System.Drawing.SizeF

The size of the image, in current resolution pixels.

GetInterpolationMode()

For internal use. Returns the current interpolation mode.

protected virtual InterpolationMode GetInterpolationMode()

Returns

InterpolationMode

InternalCreateClipRegion(IPath)

For internal use.

protected abstract IClipRegion InternalCreateClipRegion(IPath graphicsPath)

Parameters

graphicsPath IPath

Returns

IClipRegion

InternalCreateClipRegion(RectangleF)

For internal use.

protected abstract IClipRegion InternalCreateClipRegion(RectangleF bounds)

Parameters

bounds System.Drawing.RectangleF

Returns

IClipRegion

InternalCreatePath()

For internal use.

protected abstract IPath InternalCreatePath()

Returns

IPath

InternalDrawEllipse(RectangleF, Pen)

For internal use.

protected abstract void InternalDrawEllipse(RectangleF bounds, Pen pen)

Parameters

bounds System.Drawing.RectangleF
pen Pen

InternalDrawImage(RectangleF, IImage, float)

For internal use.

protected abstract void InternalDrawImage(RectangleF dstRect, IImage image, float opacity)

Parameters

dstRect System.Drawing.RectangleF
image IImage
opacity float

InternalDrawLine(PointF, PointF, Pen)

For internal use.

protected abstract void InternalDrawLine(PointF p1, PointF p2, Pen pen)

Parameters

p1 System.Drawing.PointF
p2 System.Drawing.PointF
pen Pen

InternalDrawLines(PointF[], Pen)

For internal use.

protected abstract void InternalDrawLines(PointF[] points, Pen pen)

Parameters

points System.Drawing.PointF[]
pen Pen

InternalDrawPath(IPath, Pen)

For internal use.

protected abstract void InternalDrawPath(IPath path, Pen pen)

Parameters

path IPath
pen Pen

InternalDrawPolygon(PointF[], Pen)

For internal use.

protected abstract void InternalDrawPolygon(PointF[] points, Pen pen)

Parameters

points System.Drawing.PointF[]
pen Pen

InternalDrawRectangle(RectangleF, Pen)

For internal use.

protected abstract void InternalDrawRectangle(RectangleF bounds, Pen pen)

Parameters

bounds System.Drawing.RectangleF
pen Pen

InternalDrawRoundRect(RectangleF, float, float, Pen)

For internal use.

protected abstract void InternalDrawRoundRect(RectangleF bounds, float radiusX, float radiusY, Pen pen)

Parameters

bounds System.Drawing.RectangleF
radiusX float
radiusY float
pen Pen

InternalDrawTextLayout(TextLayout, PointF)

For internal use.

protected abstract void InternalDrawTextLayout(TextLayout layout, PointF location)

Parameters

layout TextLayout
location System.Drawing.PointF

InternalDrawTextLayoutAsPath(TextLayout, PointF)

Draws a TextLayout at a specified location using graphic primitives.

protected virtual void InternalDrawTextLayoutAsPath(TextLayout layout, PointF location)

Parameters

layout TextLayout

The TextLayout to draw.

location System.Drawing.PointF

The location at which to draw the layout.

InternalDrawTextLineAsPath(TextLayout, float, TextLine, float, float, RectangleF, List<SU>, List<SU>)

Draws a TextLine within a TextLayout at the specified location using graphic primitives.

protected virtual void InternalDrawTextLineAsPath(TextLayout layout, float k, TextLine line, float x, float y, RectangleF brushBounds, List<GcGraphics.SU> listStrikethrough, List<GcGraphics.SU> listUnderline)

Parameters

layout TextLayout
k float
line TextLine
x float
y float
brushBounds System.Drawing.RectangleF
listStrikethrough System.Collections.Generic.List<T><GcGraphics.SU>
listUnderline System.Collections.Generic.List<T><GcGraphics.SU>

InternalDrawTextLineBackground(TextLayout, float, TextLine, float, float)

Fills a background of the text line.

protected virtual void InternalDrawTextLineBackground(TextLayout layout, float k, TextLine line, float x, float y)

Parameters

layout TextLayout
k float
line TextLine
x float
y float

InternalFillEllipse(RectangleF, Brush, RectangleF?, Matrix3x2?)

For internal use.

protected abstract void InternalFillEllipse(RectangleF bounds, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

bounds System.Drawing.RectangleF
brush Brush
brushBounds System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillEllipse(RectangleF, Color)

For internal use.

protected abstract void InternalFillEllipse(RectangleF bounds, Color color)

Parameters

bounds System.Drawing.RectangleF
color System.Drawing.Color

InternalFillPath(IPath, Brush, RectangleF?, Matrix3x2?)

For internal use.

protected abstract void InternalFillPath(IPath path, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

path IPath
brush Brush
brushBounds System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillPath(IPath, Color)

For internal use.

protected abstract void InternalFillPath(IPath path, Color color)

Parameters

path IPath
color System.Drawing.Color

InternalFillPolygon(PointF[], Brush, FillMode, RectangleF?, Matrix3x2?)

For internal use.

protected abstract void InternalFillPolygon(PointF[] points, Brush brush, FillMode fillMode, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

points System.Drawing.PointF[]
brush Brush
fillMode FillMode
brushBounds System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillPolygon(PointF[], Color, FillMode)

For internal use.

protected abstract void InternalFillPolygon(PointF[] points, Color color, FillMode fillMode)

Parameters

points System.Drawing.PointF[]
color System.Drawing.Color
fillMode FillMode

InternalFillRectangle(RectangleF, Brush, RectangleF?, Matrix3x2?)

For internal use.

protected abstract void InternalFillRectangle(RectangleF bounds, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

bounds System.Drawing.RectangleF
brush Brush
brushBounds System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillRectangle(RectangleF, Color)

For internal use.

protected abstract void InternalFillRectangle(RectangleF bounds, Color color)

Parameters

bounds System.Drawing.RectangleF
color System.Drawing.Color

InternalFillRoundRect(RectangleF, float, float, Brush, RectangleF?, Matrix3x2?)

For internal use.

protected abstract void InternalFillRoundRect(RectangleF bounds, float radiusX, float radiusY, Brush brush, RectangleF? brushBounds, Matrix3x2? brushTransform)

Parameters

bounds System.Drawing.RectangleF
radiusX float
radiusY float
brush Brush
brushBounds System.Drawing.RectangleF?
brushTransform System.Numerics.Matrix3x2?

InternalFillRoundRect(RectangleF, float, float, Color)

For internal use.

protected abstract void InternalFillRoundRect(RectangleF bounds, float radiusX, float radiusY, Color color)

Parameters

bounds System.Drawing.RectangleF
radiusX float
radiusY float
color System.Drawing.Color

InternalRemoveClip(IClipRegion)

For internal use.

protected abstract void InternalRemoveClip(IClipRegion clipRegion)

Parameters

clipRegion IClipRegion

InternalSetClip(IClipRegion)

For internal use.

protected abstract void InternalSetClip(IClipRegion clipRegion)

Parameters

clipRegion IClipRegion

IsBlendModeSupported(BlendMode)

Indicates whether this graphics implementation supports a specified blend mode.

public virtual bool IsBlendModeSupported(BlendMode blendMode)

Parameters

blendMode BlendMode

The blend mode to check.

Returns

bool

true if the specified blend mode is supported by the current graphics, false otherwise.

IsInterpolationModeSupported(InterpolationMode)

Indicates whether this graphics implementation supports a specified interpolation mode.

public virtual bool IsInterpolationModeSupported(InterpolationMode interpolationMode)

Parameters

interpolationMode InterpolationMode

The interpolation mode to check.

Returns

bool

true if the specified interpolation mode is supported by the current graphics, false otherwise.

See Also

MeasureImage(IImage, RectangleF, ImageAlign)

Measures how an image will be drawn using the specified bounds and image alignment.

public RectangleF[] MeasureImage(IImage image, RectangleF destBounds, ImageAlign align)

Parameters

image IImage

The image to draw.

destBounds System.Drawing.RectangleF

The destination rectangle.

align ImageAlign

The image alignment.

Returns

System.Drawing.RectangleF[]

The array of image bounds (can contain multiple rectangles if the image is tiled.

MeasureRotatedText(TextLayout, int, bool, RectangleF, RotatedTextAlignment)

Calculates the bounds of rotated text inside an unrotated rectangle.

Note that the original textLayout will be changed by this method. If necessary, create a clone in advance.

Also note that the values of the following properties are ignored: MaxWidth, MaxHeight, FlowDirection, CanSkipFirstLineWithIndentation, ObjectRects, ParagraphAlignment, MarginLeft, MarginRight, MarginTop, MarginBottom, ColumnWidth, RowHeight.

public RectangleF MeasureRotatedText(TextLayout textLayout, int angle, bool verticalStacking, RectangleF rect, RotatedTextAlignment alignment)

Parameters

textLayout TextLayout

The TextLayout to measure.

angle int

The text rotation angle, in degrees. The expected range is [-90, +90].

verticalStacking bool

If false, text lines are stacked horizontally along the top and bottom sides of rect. If true, the lines are stacked vertically along the left and right sides of the rectangle.

rect System.Drawing.RectangleF

The target rectangle for the text.

alignment RotatedTextAlignment

Alignment of the text in the target rectangle.

Returns

System.Drawing.RectangleF

The rectangle occupied by the rotated text.

MeasureString(string, Font, float, float?)

Measures a string using a specified font, font size and layout width.

public SizeF MeasureString(string text, Font font, float fontSize, float? width = null)

Parameters

text string

The string to measure.

font Font

The font to use.

fontSize float

The font size to use.

width float?

The width allocated to draw the string, or null to indicate unlimited width.

Returns

System.Drawing.SizeF

The size needed to draw the string.

MeasureString(string, TextFormat, SizeF, TextSplitOptions, out int)

Measures a string using a specified TextFormat, available layout size and TextSplitOptions. Also calculates and returns in an output parameter the number of chars that fit into the specified size.

public SizeF MeasureString(string text, TextFormat textFormat, SizeF layoutSize, TextSplitOptions splitOptions, out int fitCharCount)

Parameters

text string

The string to measure.

textFormat TextFormat

The text format to use.

layoutSize System.Drawing.SizeF

The maximum available size for the layout.

splitOptions TextSplitOptions

The options controlling how to split the text if it does not fit into the specified size.

fitCharCount int

OUT: The number of chars that fit into the specified size.

Returns

System.Drawing.SizeF

The actual size needed to draw the string.

MeasureString(string, TextFormat, SizeF, out int)

Measures a string using a specified TextFormat, available layout size and default split options (see TextSplitOptions). Also calculates and returns in an output parameter the number of chars that fit into the specified size.

public SizeF MeasureString(string text, TextFormat textFormat, SizeF layoutSize, out int fitCharCount)

Parameters

text string

The string to measure.

textFormat TextFormat

The text format to use.

layoutSize System.Drawing.SizeF

The maximum available size for the layout.

fitCharCount int

OUT: The number of chars that fit into the specified size.

Returns

System.Drawing.SizeF

The actual size needed to draw the string.

MeasureString(string, TextFormat, float?)

Measures a string using a specified TextFormat.

public SizeF MeasureString(string text, TextFormat textFormat, float? width = null)

Parameters

text string

The string to measure.

textFormat TextFormat

The text format to use.

width float?

The width allocated to draw the string, or null to indicate unlimited width.

Returns

System.Drawing.SizeF

The size needed to draw the string.

MeasureStringWithTrailingWhitespace(string, Font, float, float?)

Measures a string using a specified font, font size and layout width, taking into account the trailing whitespace at the end of each line.

public SizeF MeasureStringWithTrailingWhitespace(string text, Font font, float fontSize, float? width = null)

Parameters

text string

The string to measure.

font Font

The font to use.

fontSize float

The font size to use.

width float?

The width allocated to draw the string, or null to indicate unlimited width.

Returns

System.Drawing.SizeF

The size needed to draw the string with trailing whitespace.

MeasureStringWithTrailingWhitespace(string, TextFormat, float?)

Measures a string using a specified TextFormat, taking into account the trailing whitespace at the end of each line.

public SizeF MeasureStringWithTrailingWhitespace(string text, TextFormat textFormat, float? width = null)

Parameters

text string

The string to measure.

textFormat TextFormat

The text format to use.

width float?

The width allocated to draw the string, or null to indicate unlimited width.

Returns

System.Drawing.SizeF

The size needed to draw the string with trailing whitespace.

MeasureSvg(GcSvgDocument, PointF)

Calculates the content bounds of a specified SVG document when its viewport is drawn at a specified point.

public RectangleF MeasureSvg(GcSvgDocument svgDocument, PointF viewportPosition)

Parameters

svgDocument GcSvgDocument

The SVG document to measure.

viewportPosition System.Drawing.PointF

The coordinates for the top-left corner of SVG viewport.

Returns

System.Drawing.RectangleF

The content bounds of the resulting image.

PopClip(IClipRegion)

Removes the last clip. After this method is called, the clip is no longer applied to subsequent drawing operations.

public void PopClip(IClipRegion clipRegion)

Parameters

clipRegion IClipRegion

The clipping region.

PopTransparencyLayer()

Stops redirecting drawing operations to the transparency layer that was created by the last PushTransparencyLayer(RectangleF?, float) call.

public virtual void PopTransparencyLayer()

PushClip(IClipRegion)

Specifies a clipping region to which all subsequent drawing operations are clipped.

public void PushClip(IClipRegion clipRegion)

Parameters

clipRegion IClipRegion

The clipping region.

PushClip(IPath)

Specifies a path to which all subsequent drawing operations are clipped.

The GcGraphics.Clip object returned by this method implements IDisposable, so this method can be used with the 'using' pattern:

using (g.PushClip(...)) ...
in which case the clipping region will be removed when the returned object is disposed.
public GcGraphics.Clip PushClip(IPath clipPath)

Parameters

clipPath IPath

The IPath object defining clipping area.

Returns

GcGraphics.Clip

The GcGraphics.Clip object that removes the clipping when disposed.

PushClip(RectangleF, RectangleF)

Specifies a rectangle to which all subsequent drawing operations are clipped. Clipping is applied only if containerRect does not contain clipRect.

The GcGraphics.Clip object returned by this method implements IDisposable, so this method can be used with the 'using' pattern:

using (g.PushClip(...)) ...
in which case the clipping region will be removed when the returned object is disposed.
public GcGraphics.Clip PushClip(RectangleF clipRect, RectangleF containerRect)

Parameters

clipRect System.Drawing.RectangleF

The clipping rectangle.

containerRect System.Drawing.RectangleF

The container rectangle.

Returns

GcGraphics.Clip

The GcGraphics.Clip object that removes the clipping when disposed.

PushClip(RectangleF)

Specifies a rectangle to which all subsequent drawing operations are clipped.

The GcGraphics.Clip object returned by this method implements IDisposable, so this method can be used with the 'using' pattern:

using (g.PushClip(...)) ...
in which case the clipping region will be removed when the returned object is disposed.
public GcGraphics.Clip PushClip(RectangleF clipRect)

Parameters

clipRect System.Drawing.RectangleF

The clipping rectangle.

Returns

GcGraphics.Clip

The GcGraphics.Clip object that removes the clipping when disposed.

PushClip(RectangleF?)

Specifies a rectangle to which all subsequent drawing operations are clipped.

The GcGraphics.Clip object returned by this method implements IDisposable, so this method can be used with the 'using' pattern:

using (g.PushClip(...)) ...
in which case the clipping region will be removed when the returned object is disposed.
public GcGraphics.Clip PushClip(RectangleF? clipRect)

Parameters

clipRect System.Drawing.RectangleF?

The clipping rectangle. If this parameter is null, this method does nothing and returns null.

Returns

GcGraphics.Clip

The GcGraphics.Clip object that removes the clipping when disposed, or null.

PushTransparencyLayer(RectangleF?, float)

Adds a transparency layer to the current graphics. That layer receives all subsequent drawing operations until PopTransparencyLayer() is called.

public virtual void PushTransparencyLayer(RectangleF? contentBounds, float opacity)

Parameters

contentBounds System.Drawing.RectangleF?

The content bounds of the transparency layer. Content won't render outside these bounds. When set to null, the content bounds are effectively taken to be the bounds of the current graphics.

opacity float

An opacity value that is applied uniformly to all drawings in the layer when compositing to the backplate.

SetBlendMode(BlendMode)

For internal use. Sets the current blend mode.

protected virtual void SetBlendMode(BlendMode value)

Parameters

value BlendMode

SetInterpolationMode(InterpolationMode)

For internal use. Sets the current interpolation mode.

protected virtual void SetInterpolationMode(InterpolationMode value)

Parameters

value InterpolationMode