OfficeRasterCanvas
OfficeIMO.Drawing
Dependency-free drawing canvas for an OfficeRasterImage.
Inheritance
- object
- OfficeRasterCanvas
Usage
Explore 4 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Accepted by parameters 4
Constructors
public OfficeRasterCanvas(OfficeRasterImage image, OfficeTrueTypeFont? font = null, OfficeFontFaceCollection? fonts = null) #Creates a canvas over the supplied image.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- font OfficeIMO.Drawing.OfficeTrueTypeFont? = null
- fonts OfficeIMO.Drawing.OfficeFontFaceCollection? = null
public OfficeRasterCanvas(OfficeRasterImage image, OfficeTrueTypeFont? font, OfficeFontFaceCollection? fonts, IOfficeTextShapingProvider? textShapingProvider = null, string? textShapingLanguage = null, ICollection<OfficeImageExportDiagnostic>? diagnosticSink = null, string? diagnosticSource = null, CancellationToken cancellationToken = default) #Creates a canvas with complex-text shaping and fidelity diagnostics.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- font OfficeIMO.Drawing.OfficeTrueTypeFont?
- fonts OfficeIMO.Drawing.OfficeFontFaceCollection?
- textShapingProvider OfficeIMO.Drawing.IOfficeTextShapingProvider? = null
- textShapingLanguage string? = null
- diagnosticSink System.Collections.Generic.ICollection<OfficeIMO.Drawing.OfficeImageExportDiagnostic>? = null
- diagnosticSource string? = null
- cancellationToken System.Threading.CancellationToken = default
public OfficeRasterCanvas(OfficeRasterRenderTarget target, OfficeTrueTypeFont? font = null, OfficeFontFaceCollection? fonts = null) #Creates a canvas over the supplied supersampled render target.
Parameters
- target OfficeIMO.Drawing.OfficeRasterRenderTarget
- font OfficeIMO.Drawing.OfficeTrueTypeFont? = null
- fonts OfficeIMO.Drawing.OfficeFontFaceCollection? = null
public OfficeRasterCanvas(OfficeRasterRenderTarget target, OfficeTrueTypeFont? font, OfficeFontFaceCollection? fonts, IOfficeTextShapingProvider? textShapingProvider = null, string? textShapingLanguage = null, ICollection<OfficeImageExportDiagnostic>? diagnosticSink = null, string? diagnosticSource = null, CancellationToken cancellationToken = default) #Creates a supersampled canvas with complex-text shaping and fidelity diagnostics.
Parameters
- target OfficeIMO.Drawing.OfficeRasterRenderTarget
- font OfficeIMO.Drawing.OfficeTrueTypeFont?
- fonts OfficeIMO.Drawing.OfficeFontFaceCollection?
- textShapingProvider OfficeIMO.Drawing.IOfficeTextShapingProvider? = null
- textShapingLanguage string? = null
- diagnosticSink System.Collections.Generic.ICollection<OfficeIMO.Drawing.OfficeImageExportDiagnostic>? = null
- diagnosticSource string? = null
- cancellationToken System.Threading.CancellationToken = default
Methods
public void DrawAffineImage(OfficeRasterImage image, OfficeTransform transform, double opacity, OfficeBlendMode blendMode) #Draws an affine image with managed opacity and blend-mode compositing.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- transform OfficeIMO.Drawing.OfficeTransform
- opacity double
- blendMode OfficeIMO.Drawing.OfficeBlendMode
public void DrawAffineImage(OfficeRasterImage image, OfficeTransform transform, double opacity = 1) #Draws an image through an arbitrary destination-space affine transform, snapshotting a canvas-image source.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- transform OfficeIMO.Drawing.OfficeTransform
- opacity double = 1
public void DrawArc(double centerX, double centerY, double radiusX, double radiusY, double startDegrees, double endDegrees, OfficeColor color, double thickness = 1, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0) #Draws an elliptical arc using center/radius coordinates and optional rotation.
Parameters
- centerX double
- centerY double
- radiusX double
- radiusY double
- startDegrees double
- endDegrees double
- color OfficeIMO.OfficeColor
- thickness double = 1
- rotationDegrees double = 0
- rotationCenterX double = 0
- rotationCenterY double = 0
public void DrawDashedEllipse(double centerX, double centerY, double radiusX, double radiusY, OfficeColor color, double thickness = 1, double dashLength = 6, double gapLength = 4, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, int segments = 72, bool resetDashPatternForEachSegment = false) #Draws a dashed elliptical outline using center/radius coordinates and optional rotation.
Parameters
- centerX double
- Ellipse center X coordinate.
- centerY double
- Ellipse center Y coordinate.
- radiusX double
- Horizontal ellipse radius.
- radiusY double
- Vertical ellipse radius.
- color OfficeIMO.OfficeColor
- Stroke color.
- thickness double = 1
- Stroke thickness in canvas pixels.
- dashLength double = 6
- Visible dash length in canvas pixels.
- gapLength double = 4
- Transparent gap length in canvas pixels.
- rotationDegrees double = 0
- Clockwise rotation in degrees.
- rotationCenterX double = 0
- Rotation center X coordinate.
- rotationCenterY double = 0
- Rotation center Y coordinate.
- segments int = 72
- Number of line segments used to approximate the ellipse.
- resetDashPatternForEachSegment bool = false
- Whether the dash pattern should restart for every approximation segment.
public void DrawDashedLine(double x1, double y1, double x2, double y2, OfficeColor color, double thickness = 1, double dashLength = 6, double gapLength = 4) #Draws a dashed line segment.
Parameters
- x1 double
- y1 double
- x2 double
- y2 double
- color OfficeIMO.OfficeColor
- thickness double = 1
- dashLength double = 6
- gapLength double = 4
public void DrawDashedPolyline(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness = 1, double dashLength = 6, double gapLength = 4, bool resetDashPatternForEachSegment = false) #Draws a dashed polyline through tuple points.
Parameters
- points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>>
- color OfficeIMO.OfficeColor
- thickness double = 1
- dashLength double = 6
- gapLength double = 4
- resetDashPatternForEachSegment bool = false
public void DrawDashedPolyline(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1, double dashLength = 6, double gapLength = 4, bool resetDashPatternForEachSegment = false) #Draws a dashed polyline through the supplied points.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- Polyline points in canvas coordinates.
- color OfficeIMO.OfficeColor
- Stroke color.
- thickness double = 1
- Stroke thickness in canvas pixels.
- dashLength double = 6
- Visible dash length in canvas pixels.
- gapLength double = 4
- Transparent gap length in canvas pixels.
- resetDashPatternForEachSegment bool = false
- Whether the dash pattern should restart for every segment.
public void DrawEllipse(double x, double y, double width, double height, OfficeColor color, double thickness = 1) #Draws an ellipse outline bounded by the supplied rectangle.
Parameters
- x double
- y double
- width double
- height double
- color OfficeIMO.OfficeColor
- thickness double = 1
public void DrawEllipse(double centerX, double centerY, double radiusX, double radiusY, OfficeColor fill, OfficeColor stroke, double thickness = 1, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0) #Draws a filled and/or stroked ellipse using center/radius coordinates and optional rotation.
Parameters
- centerX double
- centerY double
- radiusX double
- radiusY double
- fill OfficeIMO.OfficeColor
- stroke OfficeIMO.OfficeColor
- thickness double = 1
- rotationDegrees double = 0
- rotationCenterX double = 0
- rotationCenterY double = 0
public void DrawHatchPatternRectangle(double x, double y, double width, double height, OfficeColor color, double step, double lineWidth, OfficeHatchPatternKind pattern) #Draws a shared hatch pattern over the supplied rectangle.
Parameters
- x double
- y double
- width double
- height double
- color OfficeIMO.OfficeColor
- step double
- lineWidth double
- pattern OfficeIMO.Drawing.OfficeHatchPatternKind
public void DrawImage(OfficeRasterImage image, double x, double y, double width, double height) #Draws an image scaled into the supplied rectangle, snapshotting it when it is also the canvas image.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- x double
- y double
- width double
- height double
public void DrawImage(OfficeRasterImage image, OfficeImageProjection projection) #Draws an image using a shared projection that carries placement, source crop, rotation, and flips.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- Image to draw.
- projection OfficeIMO.Drawing.OfficeImageProjection
- Shared image projection.
public void DrawImage(OfficeRasterImage image, OfficeImageProjection projection, bool interpolate) #Draws an image using a shared projection and the requested sampling behavior.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- projection OfficeIMO.Drawing.OfficeImageProjection
- interpolate bool
public void DrawImage(OfficeRasterImage image, double x, double y, double width, double height, double sourceLeft, double sourceTop, double sourceWidth, double sourceHeight) #Draws a source rectangle from an image scaled into the supplied destination rectangle. Source coordinates are normalized, where 0 is the left/top edge and 1 is the right/bottom edge.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- x double
- y double
- width double
- height double
- sourceLeft double
- sourceTop double
- sourceWidth double
- sourceHeight double
public void DrawImage(OfficeRasterImage image, double x, double y, double width, double height, double rotationDegrees, double rotationCenterX, double rotationCenterY) #Draws an image scaled and rotated around the supplied rotation center.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- x double
- y double
- width double
- height double
- rotationDegrees double
- rotationCenterX double
- rotationCenterY double
public void DrawImage(OfficeRasterImage image, double x, double y, double width, double height, double sourceLeft, double sourceTop, double sourceWidth, double sourceHeight, double rotationDegrees, double rotationCenterX, double rotationCenterY, bool flipHorizontal, bool flipVertical) #Draws a source rectangle from an image into the supplied destination rectangle with optional rotation and flips. Source coordinates are normalized, where 0 is the left/top edge and 1 is the right/bottom edge.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- x double
- y double
- width double
- height double
- sourceLeft double
- sourceTop double
- sourceWidth double
- sourceHeight double
- rotationDegrees double
- rotationCenterX double
- rotationCenterY double
- flipHorizontal bool
- flipVertical bool
public void DrawImage(OfficeRasterImage image, double x, double y, double width, double height, double sourceLeft, double sourceTop, double sourceWidth, double sourceHeight, double rotationDegrees, double rotationCenterX, double rotationCenterY, bool flipHorizontal, bool flipVertical, bool interpolate) #Draws a transformed image with explicit scaling interpolation behavior.
Parameters
- image OfficeIMO.Drawing.OfficeRasterImage
- x double
- y double
- width double
- height double
- sourceLeft double
- sourceTop double
- sourceWidth double
- sourceHeight double
- rotationDegrees double
- rotationCenterX double
- rotationCenterY double
- flipHorizontal bool
- flipVertical bool
- interpolate bool
public void DrawLine(double x1, double y1, double x2, double y2, OfficeColor color, double thickness = 1) #Draws a line segment.
Parameters
- x1 double
- y1 double
- x2 double
- y2 double
- color OfficeIMO.OfficeColor
- thickness double = 1
public void DrawParallelStyledLine(double x1, double y1, double x2, double y2, OfficeColor color, double thickness, double separation, OfficeStrokeDashStyle dashStyle = Solid) #Draws two parallel line segments using a shared Office stroke dash style.
Parameters
- x1 double
- Source line start X coordinate.
- y1 double
- Source line start Y coordinate.
- x2 double
- Source line end X coordinate.
- y2 double
- Source line end Y coordinate.
- color OfficeIMO.OfficeColor
- Stroke color.
- thickness double
- Stroke thickness.
- separation double
- Distance between the two parallel line centers.
- dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid
- Stroke dash style.
public void DrawPatternedEllipse(double centerX, double centerY, double radiusX, double radiusY, OfficeColor color, double thickness, IReadOnlyList<double>? dashPattern, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, int segments = 72) #Draws an elliptical outline using an alternating dash and gap pattern.
Parameters
- centerX double
- Ellipse center X coordinate.
- centerY double
- Ellipse center Y coordinate.
- radiusX double
- Horizontal ellipse radius.
- radiusY double
- Vertical ellipse radius.
- color OfficeIMO.OfficeColor
- Stroke color.
- thickness double
- Stroke thickness in canvas pixels.
- dashPattern System.Collections.Generic.IReadOnlyList<double>?
- Alternating dash and gap lengths in canvas pixels.
- rotationDegrees double = 0
- Clockwise rotation in degrees.
- rotationCenterX double = 0
- Rotation center X coordinate.
- rotationCenterY double = 0
- Rotation center Y coordinate.
- segments int = 72
- Number of line segments used to approximate the ellipse.
public void DrawPatternedLine(double x1, double y1, double x2, double y2, OfficeColor color, double thickness, IReadOnlyList<double>? dashPattern) #Draws a line segment using an alternating dash and gap pattern.
Parameters
- x1 double
- y1 double
- x2 double
- y2 double
- color OfficeIMO.OfficeColor
- thickness double
- dashPattern System.Collections.Generic.IReadOnlyList<double>?
public void DrawPatternedPolyline(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness, IReadOnlyList<double>? dashPattern, bool resetDashPatternForEachSegment = false, double dashOffset = 0) #Draws connected line segments through tuple points using an alternating dash and gap pattern.
Parameters
- points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>>
- color OfficeIMO.OfficeColor
- thickness double
- dashPattern System.Collections.Generic.IReadOnlyList<double>?
- resetDashPatternForEachSegment bool = false
- dashOffset double = 0
public void DrawPatternedPolyline(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness, IReadOnlyList<double>? dashPattern, bool resetDashPatternForEachSegment = false, double dashOffset = 0) #Draws connected line segments through the supplied points using an alternating dash and gap pattern.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- Polyline points in canvas coordinates.
- color OfficeIMO.OfficeColor
- Stroke color.
- thickness double
- Stroke thickness in canvas pixels.
- dashPattern System.Collections.Generic.IReadOnlyList<double>?
- Alternating dash and gap lengths in canvas pixels.
- resetDashPatternForEachSegment bool = false
- Whether the dash pattern should restart for every segment.
- dashOffset double = 0
- Distance into the dash pattern at which stroking begins.
public void DrawPolygon(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1) #Strokes a polygon outline.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- color OfficeIMO.OfficeColor
- thickness double = 1
public void DrawPolyline(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness = 1) #Draws connected line segments through tuple points in canvas coordinates.
Parameters
- points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>>
- color OfficeIMO.OfficeColor
- thickness double = 1
public void DrawPolyline(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1) #Draws connected line segments through the supplied points.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- Polyline points in canvas coordinates.
- color OfficeIMO.OfficeColor
- Stroke color.
- thickness double = 1
- Stroke thickness in canvas pixels.
public void DrawRectangle(double x, double y, double width, double height, OfficeColor color, double thickness = 1) #Draws a rectangle outline.
Parameters
- x double
- y double
- width double
- height double
- color OfficeIMO.OfficeColor
- thickness double = 1
public void DrawStyledEllipse(double centerX, double centerY, double radiusX, double radiusY, OfficeColor fill, OfficeColor stroke, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, int segments = 72) #Draws a filled and/or stroked ellipse using a shared Office stroke dash style.
Parameters
- centerX double
- Ellipse center X coordinate.
- centerY double
- Ellipse center Y coordinate.
- radiusX double
- Horizontal ellipse radius.
- radiusY double
- Vertical ellipse radius.
- fill OfficeIMO.OfficeColor
- Fill color.
- stroke OfficeIMO.OfficeColor
- Stroke color.
- thickness double = 1
- Stroke thickness in canvas pixels.
- dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid
- Shared Office stroke dash style.
- rotationDegrees double = 0
- Clockwise rotation in degrees.
- rotationCenterX double = 0
- Rotation center X coordinate.
- rotationCenterY double = 0
- Rotation center Y coordinate.
- segments int = 72
- Number of line segments used to approximate dashed outlines.
public void DrawStyledLine(double x1, double y1, double x2, double y2, OfficeColor color, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid) #Draws a line segment using a shared Office stroke dash style.
Parameters
- x1 double
- y1 double
- x2 double
- y2 double
- color OfficeIMO.OfficeColor
- thickness double = 1
- dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid
public void DrawStyledPolygon(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid, bool resetDashPatternForEachSegment = false) #Strokes a polygon outline through tuple points using a shared Office stroke dash style.
Parameters
- points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>>
- color OfficeIMO.OfficeColor
- thickness double = 1
- dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid
- resetDashPatternForEachSegment bool = false
public void DrawStyledPolygon(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid, bool resetDashPatternForEachSegment = false) #Strokes a polygon outline through points using a shared Office stroke dash style.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- color OfficeIMO.OfficeColor
- thickness double = 1
- dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid
- resetDashPatternForEachSegment bool = false
public void DrawStyledPolyline(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid, bool resetDashPatternForEachSegment = false) #Draws connected line segments through tuple points using a shared Office stroke dash style.
Parameters
- points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>>
- color OfficeIMO.OfficeColor
- thickness double = 1
- dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid
- resetDashPatternForEachSegment bool = false
public void DrawStyledPolyline(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid, bool resetDashPatternForEachSegment = false) #Draws connected line segments through the supplied points using a shared Office stroke dash style.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- Polyline points in canvas coordinates.
- color OfficeIMO.OfficeColor
- Stroke color.
- thickness double = 1
- Stroke thickness in canvas pixels.
- dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid
- Shared Office stroke dash style.
- resetDashPatternForEachSegment bool = false
- Whether the dash pattern should restart for every segment.
public void DrawText(string? text, double x, double y, double width, double height, OfficeColor color, OfficeFontInfo font, OfficeTextAlignment alignment = Left) #Draws text using the font's numeric face attributes and text decorations.
Parameters
- text string?
- x double
- y double
- width double
- height double
- color OfficeIMO.OfficeColor
- font OfficeIMO.Drawing.OfficeFontInfo
- alignment OfficeIMO.Drawing.OfficeTextAlignment = Left
public void DrawText(string? text, double x, double y, double width, double height, OfficeColor color, double fontSize = 12, OfficeTextAlignment alignment = Left, OfficeFontStyle style = Regular, string? fontFamily = null) #Draws text inside a rectangle using a managed TrueType font when available.
Parameters
- text string?
- x double
- y double
- width double
- height double
- color OfficeIMO.OfficeColor
- fontSize double = 12
- alignment OfficeIMO.Drawing.OfficeTextAlignment = Left
- style OfficeIMO.Drawing.OfficeFontStyle = Regular
- fontFamily string? = null
public void DrawTextLine(string? text, double anchorX, double top, double height, OfficeColor color, bool bold = false, bool italic = false, OfficeTextAlignment alignment = Center, double rotationDegrees = 0, double rotationCenterX = 0, double rotationCenterY = 0, bool underline = false, bool strikethrough = false, string? fontFamily = null, bool flipHorizontal = false, bool flipVertical = false) #Draws a single anchored text line with optional bold, italic, alignment, and rotation.
Parameters
- text string?
- Text to render.
- anchorX double
- Horizontal anchor. Left, center, or right interpretation depends on alignment.
- top double
- Top coordinate of the text line box.
- height double
- Text line height in canvas pixels.
- color OfficeIMO.OfficeColor
- Text color.
- bold bool = false
- Whether to simulate bold rendering.
- italic bool = false
- Whether to simulate italic rendering.
- alignment OfficeIMO.Drawing.OfficeTextAlignment = Center
- Horizontal alignment relative to anchorX.
- rotationDegrees double = 0
- Clockwise rotation in degrees.
- rotationCenterX double = 0
- Rotation center X coordinate.
- rotationCenterY double = 0
- Rotation center Y coordinate.
- underline bool = false
- Whether to draw an underline using the measured text width.
- strikethrough bool = false
- Whether to draw a strikethrough using the measured text width.
- fontFamily string? = null
- Requested font family fallback list.
- flipHorizontal bool = false
- Whether to mirror the rendered line horizontally around the rotation center before rotation.
- flipVertical bool = false
- Whether to mirror the rendered line vertically around the rotation center before rotation.
public void DrawTextLine(string? text, double anchorX, double top, double height, OfficeColor color, bool bold, bool italic, OfficeTextAlignment alignment, double rotationDegrees, double rotationCenterX, double rotationCenterY, bool underline, bool strikethrough, string? fontFamily, bool flipHorizontal, bool flipVertical, OfficeTextDecorationStyle underlineStyle, OfficeTextDecorationStyle strikethroughStyle, OfficeColor? decorationColor = null) #Draws a single anchored text line with independent underline and strikethrough patterns.
Parameters
- text string?
- Text to render.
- anchorX double
- Horizontal anchor. Left, center, or right interpretation depends on alignment.
- top double
- Top coordinate of the text line box.
- height double
- Text line height in canvas pixels.
- color OfficeIMO.OfficeColor
- Text color.
- bold bool
- Whether to simulate bold rendering.
- italic bool
- Whether to simulate italic rendering.
- alignment OfficeIMO.Drawing.OfficeTextAlignment
- Horizontal alignment relative to anchorX.
- rotationDegrees double
- Clockwise rotation in degrees.
- rotationCenterX double
- Rotation center X coordinate.
- rotationCenterY double
- Rotation center Y coordinate.
- underline bool
- Whether to draw an underline using the measured text width.
- strikethrough bool
- Whether to draw a strikethrough using the measured text width.
- fontFamily string?
- Requested font family fallback list.
- flipHorizontal bool
- Whether to mirror the rendered line horizontally around the rotation center before rotation.
- flipVertical bool
- Whether to mirror the rendered line vertically around the rotation center before rotation.
- underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle
- Underline pattern. A non-none value takes precedence over underline.
- strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle
- Strikethrough pattern. A non-none value takes precedence over strikethrough.
- decorationColor OfficeIMO.OfficeColor? = null
- Optional underline and strikethrough color. Null uses color.
public void DrawTextLineTransformed(string? text, double anchorX, double top, double height, OfficeColor color, OfficeTransform transform, bool bold = false, bool italic = false, OfficeTextAlignment alignment = Center, bool underline = false, bool strikethrough = false, string? fontFamily = null) #Draws a single text line through an arbitrary affine transform.
Parameters
- text string?
- Text to draw.
- anchorX double
- Untransformed text anchor X coordinate.
- top double
- Untransformed top coordinate.
- height double
- Untransformed text height.
- color OfficeIMO.OfficeColor
- Text fill color.
- transform OfficeIMO.Drawing.OfficeTransform
- Affine transform applied to text contours.
- bold bool = false
- Whether to draw a bold approximation.
- italic bool = false
- Whether to skew text contours before applying the transform.
- alignment OfficeIMO.Drawing.OfficeTextAlignment = Center
- Anchor alignment.
- underline bool = false
- Whether to draw an underline.
- strikethrough bool = false
- Whether to draw a strikethrough.
- fontFamily string? = null
- Requested font family fallback list.
public void FillEllipse(double x, double y, double width, double height, OfficeColor color) #Fills an ellipse bounded by the supplied rectangle.
Parameters
- x double
- y double
- width double
- height double
- color OfficeIMO.OfficeColor
public void FillLinearGradientPolygon(IReadOnlyList<OfficePoint> points, OfficeLinearGradient gradient) #Fills a polygon with a linear gradient fitted to the polygon bounds.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- gradient OfficeIMO.Drawing.OfficeLinearGradient
public void FillLinearGradientRectangle(double x, double y, double width, double height, OfficeLinearGradient gradient) #Fills a rectangle with a linear gradient.
Parameters
- x double
- y double
- width double
- height double
- gradient OfficeIMO.Drawing.OfficeLinearGradient
public void FillPolygon(IReadOnlyList<OfficePoint> points, OfficeColor color) #Fills a polygon.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- color OfficeIMO.OfficeColor
public void FillPolygon(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color) #Fills a polygon described by tuple points.
Parameters
- points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>>
- color OfficeIMO.OfficeColor
public void FillPolygonsEvenOdd(IReadOnlyList<IReadOnlyList<OfficePoint>> contours, OfficeColor color) #Fills multiple polygon contours using the even-odd fill rule.
Parameters
- contours System.Collections.Generic.IReadOnlyList<System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>>
- color OfficeIMO.OfficeColor
public void FillPolygonsEvenOdd(IReadOnlyList<IReadOnlyList<ValueTuple<double, double>>> contours, OfficeColor color) #Fills multiple tuple-point polygon contours using the even-odd fill rule.
Parameters
- contours System.Collections.Generic.IReadOnlyList<System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>>>
- color OfficeIMO.OfficeColor
public void FillPolygonsNonZero(IReadOnlyList<IReadOnlyList<OfficePoint>> contours, OfficeColor color) #Fills multiple polygon contours using the non-zero winding fill rule.
Parameters
- contours System.Collections.Generic.IReadOnlyList<System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>>
- color OfficeIMO.OfficeColor
public void FillRadialGradientPolygon(IReadOnlyList<OfficePoint> points, OfficeRadialGradient gradient) #Fills a polygon with a radial gradient.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- gradient OfficeIMO.Drawing.OfficeRadialGradient
public void FillRadialGradientRectangle(double x, double y, double width, double height, OfficeRadialGradient gradient) #Fills a rectangle with a radial gradient.
Parameters
- x double
- y double
- width double
- height double
- gradient OfficeIMO.Drawing.OfficeRadialGradient
public void FillRectangle(double x, double y, double width, double height, OfficeColor color) #Fills a rectangle.
Parameters
- x double
- y double
- width double
- height double
- color OfficeIMO.OfficeColor
public double MeasureText(string? text, OfficeFontInfo font) #Measures text using exact face attributes and the same fallback plan as painting.
Parameters
- text string?
- font OfficeIMO.Drawing.OfficeFontInfo
Returns
doublepublic double MeasureText(string? text, double fontSize = 12) #Measures text width with the managed font fallback used by this canvas.
Parameters
- text string?
- fontSize double = 12
Returns
doublepublic double MeasureText(string? text, double fontSize, string? fontFamily) #Measures text width with the requested font family when it can be resolved without platform font APIs.
Parameters
- text string?
- fontSize double
- fontFamily string?
Returns
doublepublic double MeasureText(string? text, double fontSize, string? fontFamily, OfficeFontStyle style) #Measures text width with a requested family and bold/italic scoped face when available.
Parameters
- text string?
- fontSize double
- fontFamily string?
- style OfficeIMO.Drawing.OfficeFontStyle
Returns
doublepublic IDisposable PushClipPolygon(IReadOnlyList<OfficePoint> points) #Restricts subsequent raster drawing to the supplied polygon until the returned scope is disposed. Nested clips are intersected with the current clip.
Parameters
- points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>
- Polygon points in canvas coordinates.
Returns
IDisposable A disposable scope that restores the previous clip.public IDisposable PushClipPolygonsEvenOdd(IReadOnlyList<IReadOnlyList<OfficePoint>> contours) #Restricts subsequent raster drawing to the supplied even-odd contours until the returned scope is disposed. Nested clips are intersected with the current clip.
Parameters
- contours System.Collections.Generic.IReadOnlyList<System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>>
- Closed contours in canvas coordinates.
Returns
IDisposable A disposable scope that restores the previous clip.public IDisposable PushClipPolygonsNonZero(IReadOnlyList<IReadOnlyList<OfficePoint>> contours) #Restricts subsequent raster drawing to the supplied non-zero winding contours until the returned scope is disposed. Nested clips are intersected with the current clip.
Parameters
- contours System.Collections.Generic.IReadOnlyList<System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>>
- Closed contours in canvas coordinates.
Returns
IDisposable A disposable scope that restores the previous clip.public IDisposable PushClipRectangle(double x, double y, double width, double height) #Restricts subsequent raster drawing to the supplied rectangular bounds until the returned scope is disposed. Nested clips are intersected with the current clip.
Parameters
- x double
- Left edge of the clipping rectangle.
- y double
- Top edge of the clipping rectangle.
- width double
- Width of the clipping rectangle.
- height double
- Height of the clipping rectangle.
Returns
IDisposable A disposable scope that restores the previous clip.