# OfficeRasterCanvas

Dependency-free drawing canvas for an OfficeRasterImage.

Class 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeRasterCanvas.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L39)

**Modifiers**

sealed

Dependency-free drawing canvas for an [OfficeRasterImage](/api/core/officeimo-drawing-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

- Method [OfficeBorderBoxRenderer.DrawRaster](/api/core/officeimo-drawing-officeborderboxrenderer/#method-drawraster-officeimo-drawing-officerastercanvas-double-double-double-double-officeimo-drawing-officeborderbox) parameter `canvas`
- Method [OfficeTextBlockRenderer.DrawRasterRichTextBlock](/api/core/officeimo-drawing-officetextblockrenderer/#method-drawrasterrichtextblock-officeimo-drawing-officerastercanvas-officeimo-drawing-officerichtextblocklayout-double-double-double-double-officeimo-drawing-officetextalignment-officeimo-drawing-officetextverticalalignment-double-double-double-boolean-boolean-boolean) parameter `canvas`
- Method [OfficeTextBlockRenderer.DrawRasterTextBlock](/api/core/officeimo-drawing-officetextblockrenderer/#method-drawrastertextblock-officeimo-drawing-officerastercanvas-officeimo-drawing-officetextblocklayout-double-double-double-double-officeimo-officecolor-officeimo-drawing-officetextalignment-officeimo-drawing-officetextverticalalignment-boolean-boolean-boolean-double-double-double-boolean-double-boolean-string-boolean-boolean) parameter `canvas`
- Method [OfficeTextBlockRenderer.DrawRasterTextBox](/api/core/officeimo-drawing-officetextblockrenderer/#method-drawrastertextbox-officeimo-drawing-officerastercanvas-officeimo-drawing-officetextblockrenderplan-officeimo-officecolor-boolean-boolean-boolean-nullable-officeimo-drawing-officetextalignment-nullable-officeimo-drawing-officetextverticalalignment-double-double-double-nullable-officeimo-officecolor-double-double-boolean-double-boolean-string) parameter `canvas`

Filter members 

Show inherited

## Constructors

OfficeRasterCanvas 4 overloads

`public OfficeRasterCanvas(OfficeRasterImage image, OfficeTrueTypeFont? font = null, OfficeFontFaceCollection? fonts = null)` [#](#constructor-ctor-officeimo-drawing-officerasterimage-officeimo-drawing-officetruetypefont-officeimo-drawing-officefontfacecollection)

[OfficeRasterCanvas.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L39)

Creates a canvas over the supplied image.

Parameters

**image OfficeIMO.Drawing.OfficeRasterImage required**

**font OfficeIMO.Drawing.OfficeTrueTypeFont? = null optional**

**fonts OfficeIMO.Drawing.OfficeFontFaceCollection? = null optional**

`public OfficeRasterCanvas(OfficeRasterImage image, OfficeTrueTypeFont? font, OfficeFontFaceCollection? fonts, IOfficeTextShapingProvider? textShapingProvider = null, string? textShapingLanguage = null, ICollection<OfficeImageExportDiagnostic>? diagnosticSink = null, string? diagnosticSource = null, CancellationToken cancellationToken = default)` [#](#member-a5bf904d0c56f7c1386edce7)

[OfficeRasterCanvas.Budgets.cs:5](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Budgets.cs#L5)

Creates a canvas with complex-text shaping and fidelity diagnostics.

Parameters

**image OfficeIMO.Drawing.OfficeRasterImage required**

**font OfficeIMO.Drawing.OfficeTrueTypeFont? required**

**fonts OfficeIMO.Drawing.OfficeFontFaceCollection? required**

**textShapingProvider OfficeIMO.Drawing.IOfficeTextShapingProvider? = null optional**

**textShapingLanguage string? = null optional**

**diagnosticSink System.Collections.Generic.ICollection<OfficeIMO.Drawing.OfficeImageExportDiagnostic>? = null optional**

**diagnosticSource string? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

`public OfficeRasterCanvas(OfficeRasterRenderTarget target, OfficeTrueTypeFont? font = null, OfficeFontFaceCollection? fonts = null)` [#](#constructor-ctor-officeimo-drawing-officerasterrendertarget-officeimo-drawing-officetruetypefont-officeimo-drawing-officefontfacecollection)

[OfficeRasterCanvas.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L77)

Creates a canvas over the supplied supersampled render target.

Parameters

**target OfficeIMO.Drawing.OfficeRasterRenderTarget required**

**font OfficeIMO.Drawing.OfficeTrueTypeFont? = null optional**

**fonts OfficeIMO.Drawing.OfficeFontFaceCollection? = null optional**

`public OfficeRasterCanvas(OfficeRasterRenderTarget target, OfficeTrueTypeFont? font, OfficeFontFaceCollection? fonts, IOfficeTextShapingProvider? textShapingProvider = null, string? textShapingLanguage = null, ICollection<OfficeImageExportDiagnostic>? diagnosticSink = null, string? diagnosticSource = null, CancellationToken cancellationToken = default)` [#](#member-5f6dae4ecbbf6575df469991)

[OfficeRasterCanvas.Budgets.cs:5](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Budgets.cs#L5)

Creates a supersampled canvas with complex-text shaping and fidelity diagnostics.

Parameters

**target OfficeIMO.Drawing.OfficeRasterRenderTarget required**

**font OfficeIMO.Drawing.OfficeTrueTypeFont? required**

**fonts OfficeIMO.Drawing.OfficeFontFaceCollection? required**

**textShapingProvider OfficeIMO.Drawing.IOfficeTextShapingProvider? = null optional**

**textShapingLanguage string? = null optional**

**diagnosticSink System.Collections.Generic.ICollection<OfficeIMO.Drawing.OfficeImageExportDiagnostic>? = null optional**

**diagnosticSource string? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

## Methods

DrawAffineImage 2 overloads

`public void DrawAffineImage(OfficeRasterImage image, OfficeTransform transform, double opacity, OfficeBlendMode blendMode)` [#](#method-drawaffineimage-officeimo-drawing-officerasterimage-officeimo-drawing-officetransform-double-officeimo-drawing-officeblendmode)

[OfficeRasterCanvas.Compositing.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Compositing.cs#L7)

Draws an affine image with managed opacity and blend-mode compositing.

Parameters

**image OfficeIMO.Drawing.OfficeRasterImage required**

**transform OfficeIMO.Drawing.OfficeTransform required**

**opacity double required**

**blendMode OfficeIMO.Drawing.OfficeBlendMode required**

`public void DrawAffineImage(OfficeRasterImage image, OfficeTransform transform, double opacity = 1)` [#](#method-drawaffineimage-officeimo-drawing-officerasterimage-officeimo-drawing-officetransform-double)

[OfficeRasterCanvas.cs:530](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L530)

Draws an image through an arbitrary destination-space affine transform, snapshotting a canvas-image source.

Parameters

**image OfficeIMO.Drawing.OfficeRasterImage required**

**transform OfficeIMO.Drawing.OfficeTransform required**

**opacity double = 1 optional**

`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)` [#](#method-drawarc-double-double-double-double-double-double-officeimo-officecolor-double-double-double-double)

[OfficeRasterCanvas.cs:253](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L253)

Draws an elliptical arc using center/radius coordinates and optional rotation.

Parameters

**centerX double required**

**centerY double required**

**radiusX double required**

**radiusY double required**

**startDegrees double required**

**endDegrees double required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

**rotationDegrees double = 0 optional**

**rotationCenterX double = 0 optional**

**rotationCenterY double = 0 optional**

`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)` [#](#method-drawdashedellipse-double-double-double-double-officeimo-officecolor-double-double-double-double-double-double-int32-boolean)

[OfficeRasterCanvas.DashedShapes.cs:85](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.DashedShapes.cs#L85)

Draws a dashed elliptical outline using center/radius coordinates and optional rotation.

Parameters

**centerX double required**

Ellipse center X coordinate.

**centerY double required**

Ellipse center Y coordinate.

**radiusX double required**

Horizontal ellipse radius.

**radiusY double required**

Vertical ellipse radius.

**color OfficeIMO.OfficeColor required**

Stroke color.

**thickness double = 1 optional**

Stroke thickness in canvas pixels.

**dashLength double = 6 optional**

Visible dash length in canvas pixels.

**gapLength double = 4 optional**

Transparent gap length in canvas pixels.

**rotationDegrees double = 0 optional**

Clockwise rotation in degrees.

**rotationCenterX double = 0 optional**

Rotation center X coordinate.

**rotationCenterY double = 0 optional**

Rotation center Y coordinate.

**segments int = 72 optional**

Number of line segments used to approximate the ellipse.

**resetDashPatternForEachSegment bool = false optional**

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)` [#](#method-drawdashedline-double-double-double-double-officeimo-officecolor-double-double-double)

[OfficeRasterCanvas.cs:200](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L200)

Draws a dashed line segment.

Parameters

**x1 double required**

**y1 double required**

**x2 double required**

**y2 double required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

**dashLength double = 6 optional**

**gapLength double = 4 optional**

DrawDashedPolyline 2 overloads

`public void DrawDashedPolyline(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness = 1, double dashLength = 6, double gapLength = 4, bool resetDashPatternForEachSegment = false)` [#](#method-drawdashedpolyline-collections-generic-ireadonlylist-system-valuetuple-system-double-system-double-officeimo-officecolor-double-double-double-boolean)

[OfficeRasterCanvas.Points.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Points.cs#L58)

Draws a dashed polyline through tuple points.

Parameters

**points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>> required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

**dashLength double = 6 optional**

**gapLength double = 4 optional**

**resetDashPatternForEachSegment bool = false optional**

`public void DrawDashedPolyline(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1, double dashLength = 6, double gapLength = 4, bool resetDashPatternForEachSegment = false)` [#](#method-drawdashedpolyline-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-officecolor-double-double-double-boolean)

[OfficeRasterCanvas.Polylines.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Polylines.cs#L77)

Draws a dashed polyline through the supplied points.

Parameters

**points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required**

Polyline points in canvas coordinates.

**color OfficeIMO.OfficeColor required**

Stroke color.

**thickness double = 1 optional**

Stroke thickness in canvas pixels.

**dashLength double = 6 optional**

Visible dash length in canvas pixels.

**gapLength double = 4 optional**

Transparent gap length in canvas pixels.

**resetDashPatternForEachSegment bool = false optional**

Whether the dash pattern should restart for every segment.

DrawEllipse 2 overloads

`public void DrawEllipse(double x, double y, double width, double height, OfficeColor color, double thickness = 1)` [#](#method-drawellipse-double-double-double-double-officeimo-officecolor-double)

[OfficeRasterCanvas.cs:165](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L165)

Draws an ellipse outline bounded by the supplied rectangle.

Parameters

**x double required**

**y double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

`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)` [#](#method-drawellipse-double-double-double-double-officeimo-officecolor-officeimo-officecolor-double-double-double-double)

[OfficeRasterCanvas.cs:181](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L181)

Draws a filled and/or stroked ellipse using center/radius coordinates and optional rotation.

Parameters

**centerX double required**

**centerY double required**

**radiusX double required**

**radiusY double required**

**fill OfficeIMO.OfficeColor required**

**stroke OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

**rotationDegrees double = 0 optional**

**rotationCenterX double = 0 optional**

**rotationCenterY double = 0 optional**

`public void DrawHatchPatternRectangle(double x, double y, double width, double height, OfficeColor color, double step, double lineWidth, OfficeHatchPatternKind pattern)` [#](#method-drawhatchpatternrectangle-double-double-double-double-officeimo-officecolor-double-double-officeimo-drawing-officehatchpatternkind)

[OfficeRasterCanvas.HatchPatterns.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.HatchPatterns.cs#L9)

Draws a shared hatch pattern over the supplied rectangle.

Parameters

**x double required**

**y double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

**step double required**

**lineWidth double required**

**pattern OfficeIMO.Drawing.OfficeHatchPatternKind required**

DrawImage 7 overloads

`public void DrawImage(OfficeRasterImage image, double x, double y, double width, double height)` [#](#method-drawimage-officeimo-drawing-officerasterimage-double-double-double-double)

[OfficeRasterCanvas.cs:326](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L326)

Draws an image scaled into the supplied rectangle, snapshotting it when it is also the canvas image.

Parameters

**image OfficeIMO.Drawing.OfficeRasterImage required**

**x double required**

**y double required**

**width double required**

**height double required**

`public void DrawImage(OfficeRasterImage image, OfficeImageProjection projection)` [#](#method-drawimage-officeimo-drawing-officerasterimage-officeimo-drawing-officeimageprojection)

[OfficeRasterCanvas.cs:349](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L349)

Draws an image using a shared projection that carries placement, source crop, rotation, and flips.

Parameters

**image OfficeIMO.Drawing.OfficeRasterImage required**

Image to draw.

**projection OfficeIMO.Drawing.OfficeImageProjection required**

Shared image projection.

`public void DrawImage(OfficeRasterImage image, OfficeImageProjection projection, bool interpolate)` [#](#method-drawimage-officeimo-drawing-officerasterimage-officeimo-drawing-officeimageprojection-boolean)

[OfficeRasterCanvas.cs:354](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L354)

Draws an image using a shared projection and the requested sampling behavior.

Parameters

**image OfficeIMO.Drawing.OfficeRasterImage required**

**projection OfficeIMO.Drawing.OfficeImageProjection required**

**interpolate bool required**

`public void DrawImage(OfficeRasterImage image, double x, double y, double width, double height, double sourceLeft, double sourceTop, double sourceWidth, double sourceHeight)` [#](#method-drawimage-officeimo-drawing-officerasterimage-double-double-double-double-double-double-double-double)

[OfficeRasterCanvas.cs:377](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L377)

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 required**

**x double required**

**y double required**

**width double required**

**height double required**

**sourceLeft double required**

**sourceTop double required**

**sourceWidth double required**

**sourceHeight double required**

`public void DrawImage(OfficeRasterImage image, double x, double y, double width, double height, double rotationDegrees, double rotationCenterX, double rotationCenterY)` [#](#method-drawimage-officeimo-drawing-officerasterimage-double-double-double-double-double-double-double)

[OfficeRasterCanvas.cs:396](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L396)

Draws an image scaled and rotated around the supplied rotation center.

Parameters

**image OfficeIMO.Drawing.OfficeRasterImage required**

**x double required**

**y double required**

**width double required**

**height double required**

**rotationDegrees double required**

**rotationCenterX double required**

**rotationCenterY double required**

`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)` [#](#method-drawimage-officeimo-drawing-officerasterimage-double-double-double-double-double-double-double-double-double-double-double-boolean-boolean)

[OfficeRasterCanvas.cs:432](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L432)

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 required**

**x double required**

**y double required**

**width double required**

**height double required**

**sourceLeft double required**

**sourceTop double required**

**sourceWidth double required**

**sourceHeight double required**

**rotationDegrees double required**

**rotationCenterX double required**

**rotationCenterY double required**

**flipHorizontal bool required**

**flipVertical bool required**

`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)` [#](#method-drawimage-officeimo-drawing-officerasterimage-double-double-double-double-double-double-double-double-double-double-double-boolean-boolean-boolean)

[OfficeRasterCanvas.cs:454](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L454)

Draws a transformed image with explicit scaling interpolation behavior.

Parameters

**image OfficeIMO.Drawing.OfficeRasterImage required**

**x double required**

**y double required**

**width double required**

**height double required**

**sourceLeft double required**

**sourceTop double required**

**sourceWidth double required**

**sourceHeight double required**

**rotationDegrees double required**

**rotationCenterX double required**

**rotationCenterY double required**

**flipHorizontal bool required**

**flipVertical bool required**

**interpolate bool required**

`public void DrawLine(double x1, double y1, double x2, double y2, OfficeColor color, double thickness = 1)` [#](#method-drawline-double-double-double-double-officeimo-officecolor-double)

[OfficeRasterCanvas.cs:191](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L191)

Draws a line segment.

Parameters

**x1 double required**

**y1 double required**

**x2 double required**

**y2 double required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

`public void DrawParallelStyledLine(double x1, double y1, double x2, double y2, OfficeColor color, double thickness, double separation, OfficeStrokeDashStyle dashStyle = Solid)` [#](#method-drawparallelstyledline-double-double-double-double-officeimo-officecolor-double-double-officeimo-drawing-officestrokedashstyle)

[OfficeRasterCanvas.cs:227](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L227)

Draws two parallel line segments using a shared Office stroke dash style.

Parameters

**x1 double required**

Source line start X coordinate.

**y1 double required**

Source line start Y coordinate.

**x2 double required**

Source line end X coordinate.

**y2 double required**

Source line end Y coordinate.

**color OfficeIMO.OfficeColor required**

Stroke color.

**thickness double required**

Stroke thickness.

**separation double required**

Distance between the two parallel line centers.

**dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optional**

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)` [#](#method-drawpatternedellipse-double-double-double-double-officeimo-officecolor-double-collections-generic-ireadonlylist-system-double-double-double-double-int32)

[OfficeRasterCanvas.DashedShapes.cs:118](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.DashedShapes.cs#L118)

Draws an elliptical outline using an alternating dash and gap pattern.

Parameters

**centerX double required**

Ellipse center X coordinate.

**centerY double required**

Ellipse center Y coordinate.

**radiusX double required**

Horizontal ellipse radius.

**radiusY double required**

Vertical ellipse radius.

**color OfficeIMO.OfficeColor required**

Stroke color.

**thickness double required**

Stroke thickness in canvas pixels.

**dashPattern System.Collections.Generic.IReadOnlyList<double>? required**

Alternating dash and gap lengths in canvas pixels.

**rotationDegrees double = 0 optional**

Clockwise rotation in degrees.

**rotationCenterX double = 0 optional**

Rotation center X coordinate.

**rotationCenterY double = 0 optional**

Rotation center Y coordinate.

**segments int = 72 optional**

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)` [#](#method-drawpatternedline-double-double-double-double-officeimo-officecolor-double-collections-generic-ireadonlylist-system-double)

[OfficeRasterCanvas.cs:237](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L237)

Draws a line segment using an alternating dash and gap pattern.

Parameters

**x1 double required**

**y1 double required**

**x2 double required**

**y2 double required**

**color OfficeIMO.OfficeColor required**

**thickness double required**

**dashPattern System.Collections.Generic.IReadOnlyList<double>? required**

DrawPatternedPolyline 2 overloads

`public void DrawPatternedPolyline(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness, IReadOnlyList<double>? dashPattern, bool resetDashPatternForEachSegment = false, double dashOffset = 0)` [#](#method-drawpatternedpolyline-collections-generic-ireadonlylist-system-valuetuple-system-double-system-double-officeimo-officecolor-double-collections-generic-ireadonlylist-system-double-boolean-double)

[OfficeRasterCanvas.Points.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Points.cs#L41)

Draws connected line segments through tuple points using an alternating dash and gap pattern.

Parameters

**points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>> required**

**color OfficeIMO.OfficeColor required**

**thickness double required**

**dashPattern System.Collections.Generic.IReadOnlyList<double>? required**

**resetDashPatternForEachSegment bool = false optional**

**dashOffset double = 0 optional**

`public void DrawPatternedPolyline(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness, IReadOnlyList<double>? dashPattern, bool resetDashPatternForEachSegment = false, double dashOffset = 0)` [#](#method-drawpatternedpolyline-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-officecolor-double-collections-generic-ireadonlylist-system-double-boolean-double)

[OfficeRasterCanvas.Polylines.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Polylines.cs#L55)

Draws connected line segments through the supplied points using an alternating dash and gap pattern.

Parameters

**points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required**

Polyline points in canvas coordinates.

**color OfficeIMO.OfficeColor required**

Stroke color.

**thickness double required**

Stroke thickness in canvas pixels.

**dashPattern System.Collections.Generic.IReadOnlyList<double>? required**

Alternating dash and gap lengths in canvas pixels.

**resetDashPatternForEachSegment bool = false optional**

Whether the dash pattern should restart for every segment.

**dashOffset double = 0 optional**

Distance into the dash pattern at which stroking begins.

`public void DrawPolygon(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1)` [#](#method-drawpolygon-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-officecolor-double)

[OfficeRasterCanvas.cs:318](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L318)

Strokes a polygon outline.

Parameters

**points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

DrawPolyline 2 overloads

`public void DrawPolyline(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness = 1)` [#](#method-drawpolyline-collections-generic-ireadonlylist-system-valuetuple-system-double-system-double-officeimo-officecolor-double)

[OfficeRasterCanvas.Points.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Points.cs#L8)

Draws connected line segments through tuple points in canvas coordinates.

Parameters

**points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>> required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

`public void DrawPolyline(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1)` [#](#method-drawpolyline-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-officecolor-double)

[OfficeRasterCanvas.Polylines.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Polylines.cs#L11)

Draws connected line segments through the supplied points.

Parameters

**points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required**

Polyline points in canvas coordinates.

**color OfficeIMO.OfficeColor required**

Stroke color.

**thickness double = 1 optional**

Stroke thickness in canvas pixels.

`public void DrawRectangle(double x, double y, double width, double height, OfficeColor color, double thickness = 1)` [#](#method-drawrectangle-double-double-double-double-officeimo-officecolor-double)

[OfficeRasterCanvas.cs:153](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L153)

Draws a rectangle outline.

Parameters

**x double required**

**y double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

`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)` [#](#method-drawstyledellipse-double-double-double-double-officeimo-officecolor-officeimo-officecolor-double-officeimo-drawing-officestrokedashstyle-double-double-double-int32)

[OfficeRasterCanvas.DashedShapes.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.DashedShapes.cs#L32)

Draws a filled and/or stroked ellipse using a shared Office stroke dash style.

Parameters

**centerX double required**

Ellipse center X coordinate.

**centerY double required**

Ellipse center Y coordinate.

**radiusX double required**

Horizontal ellipse radius.

**radiusY double required**

Vertical ellipse radius.

**fill OfficeIMO.OfficeColor required**

Fill color.

**stroke OfficeIMO.OfficeColor required**

Stroke color.

**thickness double = 1 optional**

Stroke thickness in canvas pixels.

**dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optional**

Shared Office stroke dash style.

**rotationDegrees double = 0 optional**

Clockwise rotation in degrees.

**rotationCenterX double = 0 optional**

Rotation center X coordinate.

**rotationCenterY double = 0 optional**

Rotation center Y coordinate.

**segments int = 72 optional**

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)` [#](#method-drawstyledline-double-double-double-double-officeimo-officecolor-double-officeimo-drawing-officestrokedashstyle)

[OfficeRasterCanvas.cs:207](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L207)

Draws a line segment using a shared Office stroke dash style.

Parameters

**x1 double required**

**y1 double required**

**x2 double required**

**y2 double required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

**dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optional**

DrawStyledPolygon 2 overloads

`public void DrawStyledPolygon(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid, bool resetDashPatternForEachSegment = false)` [#](#method-drawstyledpolygon-collections-generic-ireadonlylist-system-valuetuple-system-double-system-double-officeimo-officecolor-double-officeimo-drawing-officestrokedashstyle-boolean)

[OfficeRasterCanvas.Points.cs:74](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Points.cs#L74)

Strokes a polygon outline through tuple points using a shared Office stroke dash style.

Parameters

**points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>> required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

**dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optional**

**resetDashPatternForEachSegment bool = false optional**

`public void DrawStyledPolygon(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid, bool resetDashPatternForEachSegment = false)` [#](#method-drawstyledpolygon-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-officecolor-double-officeimo-drawing-officestrokedashstyle-boolean)

[OfficeRasterCanvas.Points.cs:90](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Points.cs#L90)

Strokes a polygon outline through points using a shared Office stroke dash style.

Parameters

**points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

**dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optional**

**resetDashPatternForEachSegment bool = false optional**

DrawStyledPolyline 2 overloads

`public void DrawStyledPolyline(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid, bool resetDashPatternForEachSegment = false)` [#](#method-drawstyledpolyline-collections-generic-ireadonlylist-system-valuetuple-system-double-system-double-officeimo-officecolor-double-officeimo-drawing-officestrokedashstyle-boolean)

[OfficeRasterCanvas.Points.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Points.cs#L24)

Draws connected line segments through tuple points using a shared Office stroke dash style.

Parameters

**points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>> required**

**color OfficeIMO.OfficeColor required**

**thickness double = 1 optional**

**dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optional**

**resetDashPatternForEachSegment bool = false optional**

`public void DrawStyledPolyline(IReadOnlyList<OfficePoint> points, OfficeColor color, double thickness = 1, OfficeStrokeDashStyle dashStyle = Solid, bool resetDashPatternForEachSegment = false)` [#](#method-drawstyledpolyline-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-officecolor-double-officeimo-drawing-officestrokedashstyle-boolean)

[OfficeRasterCanvas.Polylines.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Polylines.cs#L31)

Draws connected line segments through the supplied points using a shared Office stroke dash style.

Parameters

**points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required**

Polyline points in canvas coordinates.

**color OfficeIMO.OfficeColor required**

Stroke color.

**thickness double = 1 optional**

Stroke thickness in canvas pixels.

**dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optional**

Shared Office stroke dash style.

**resetDashPatternForEachSegment bool = false optional**

Whether the dash pattern should restart for every segment.

DrawText 2 overloads

`public void DrawText(string? text, double x, double y, double width, double height, OfficeColor color, OfficeFontInfo font, OfficeTextAlignment alignment = Left)` [#](#method-drawtext-string-double-double-double-double-officeimo-officecolor-officeimo-drawing-officefontinfo-officeimo-drawing-officetextalignment)

[OfficeRasterCanvas.FontFaces.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.FontFaces.cs#L14)

Draws text using the font's numeric face attributes and text decorations.

Parameters

**text string? required**

**x double required**

**y double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

**font OfficeIMO.Drawing.OfficeFontInfo required**

**alignment OfficeIMO.Drawing.OfficeTextAlignment = Left optional**

`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)` [#](#method-drawtext-string-double-double-double-double-officeimo-officecolor-double-officeimo-drawing-officetextalignment-officeimo-drawing-officefontstyle-string)

[OfficeRasterCanvas.Text.cs:97](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Text.cs#L97)

Draws text inside a rectangle using a managed TrueType font when available.

Parameters

**text string? required**

**x double required**

**y double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

**fontSize double = 12 optional**

**alignment OfficeIMO.Drawing.OfficeTextAlignment = Left optional**

**style OfficeIMO.Drawing.OfficeFontStyle = Regular optional**

**fontFamily string? = null optional**

DrawTextLine 2 overloads

`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)` [#](#method-drawtextline-string-double-double-double-officeimo-officecolor-boolean-boolean-officeimo-drawing-officetextalignment-double-double-double-boolean-boolean-string-boolean-boolean)

[OfficeRasterCanvas.Text.Line.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Text.Line.cs#L43)

Draws a single anchored text line with optional bold, italic, alignment, and rotation.

Parameters

**text string? required**

Text to render.

**anchorX double required**

Horizontal anchor. Left, center, or right interpretation depends on alignment.

**top double required**

Top coordinate of the text line box.

**height double required**

Text line height in canvas pixels.

**color OfficeIMO.OfficeColor required**

Text color.

**bold bool = false optional**

Whether to simulate bold rendering.

**italic bool = false optional**

Whether to simulate italic rendering.

**alignment OfficeIMO.Drawing.OfficeTextAlignment = Center optional**

Horizontal alignment relative to anchorX.

**rotationDegrees double = 0 optional**

Clockwise rotation in degrees.

**rotationCenterX double = 0 optional**

Rotation center X coordinate.

**rotationCenterY double = 0 optional**

Rotation center Y coordinate.

**underline bool = false optional**

Whether to draw an underline using the measured text width.

**strikethrough bool = false optional**

Whether to draw a strikethrough using the measured text width.

**fontFamily string? = null optional**

Requested font family fallback list.

**flipHorizontal bool = false optional**

Whether to mirror the rendered line horizontally around the rotation center before rotation.

**flipVertical bool = false optional**

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)` [#](#member-03e38de10c8473fd53db30b4)

[OfficeRasterCanvas.Text.Line.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Text.Line.cs#L105)

Draws a single anchored text line with independent underline and strikethrough patterns.

Parameters

**text string? required**

Text to render.

**anchorX double required**

Horizontal anchor. Left, center, or right interpretation depends on alignment.

**top double required**

Top coordinate of the text line box.

**height double required**

Text line height in canvas pixels.

**color OfficeIMO.OfficeColor required**

Text color.

**bold bool required**

Whether to simulate bold rendering.

**italic bool required**

Whether to simulate italic rendering.

**alignment OfficeIMO.Drawing.OfficeTextAlignment required**

Horizontal alignment relative to anchorX.

**rotationDegrees double required**

Clockwise rotation in degrees.

**rotationCenterX double required**

Rotation center X coordinate.

**rotationCenterY double required**

Rotation center Y coordinate.

**underline bool required**

Whether to draw an underline using the measured text width.

**strikethrough bool required**

Whether to draw a strikethrough using the measured text width.

**fontFamily string? required**

Requested font family fallback list.

**flipHorizontal bool required**

Whether to mirror the rendered line horizontally around the rotation center before rotation.

**flipVertical bool required**

Whether to mirror the rendered line vertically around the rotation center before rotation.

**underlineStyle OfficeIMO.Drawing.OfficeTextDecorationStyle required**

Underline pattern. A non-none value takes precedence over underline.

**strikethroughStyle OfficeIMO.Drawing.OfficeTextDecorationStyle required**

Strikethrough pattern. A non-none value takes precedence over strikethrough.

**decorationColor OfficeIMO.OfficeColor? = null optional**

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)` [#](#method-drawtextlinetransformed-string-double-double-double-officeimo-officecolor-officeimo-drawing-officetransform-boolean-boolean-officeimo-drawing-officetextalignment-boolean-boolean-string)

[OfficeRasterCanvas.Text.Line.cs:230](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Text.Line.cs#L230)

Draws a single text line through an arbitrary affine transform.

Parameters

**text string? required**

Text to draw.

**anchorX double required**

Untransformed text anchor X coordinate.

**top double required**

Untransformed top coordinate.

**height double required**

Untransformed text height.

**color OfficeIMO.OfficeColor required**

Text fill color.

**transform OfficeIMO.Drawing.OfficeTransform required**

Affine transform applied to text contours.

**bold bool = false optional**

Whether to draw a bold approximation.

**italic bool = false optional**

Whether to skew text contours before applying the transform.

**alignment OfficeIMO.Drawing.OfficeTextAlignment = Center optional**

Anchor alignment.

**underline bool = false optional**

Whether to draw an underline.

**strikethrough bool = false optional**

Whether to draw a strikethrough.

**fontFamily string? = null optional**

Requested font family fallback list.

`public void FillEllipse(double x, double y, double width, double height, OfficeColor color)` [#](#method-fillellipse-double-double-double-double-officeimo-officecolor)

[OfficeRasterCanvas.cs:159](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L159)

Fills an ellipse bounded by the supplied rectangle.

Parameters

**x double required**

**y double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

`public void FillLinearGradientPolygon(IReadOnlyList<OfficePoint> points, OfficeLinearGradient gradient)` [#](#method-filllineargradientpolygon-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-drawing-officelineargradient)

[OfficeRasterCanvas.cs:276](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L276)

Fills a polygon with a linear gradient fitted to the polygon bounds.

Parameters

**points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required**

**gradient OfficeIMO.Drawing.OfficeLinearGradient required**

`public void FillLinearGradientRectangle(double x, double y, double width, double height, OfficeLinearGradient gradient)` [#](#method-filllineargradientrectangle-double-double-double-double-officeimo-drawing-officelineargradient)

[OfficeRasterCanvas.cs:139](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L139)

Fills a rectangle with a linear gradient.

Parameters

**x double required**

**y double required**

**width double required**

**height double required**

**gradient OfficeIMO.Drawing.OfficeLinearGradient required**

FillPolygon 2 overloads

`public void FillPolygon(IReadOnlyList<OfficePoint> points, OfficeColor color)` [#](#method-fillpolygon-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-officecolor)

[OfficeRasterCanvas.cs:267](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L267)

Fills a polygon.

Parameters

**points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required**

**color OfficeIMO.OfficeColor required**

`public void FillPolygon(IReadOnlyList<ValueTuple<double, double>> points, OfficeColor color)` [#](#method-fillpolygon-collections-generic-ireadonlylist-system-valuetuple-system-double-system-double-officeimo-officecolor)

[OfficeRasterCanvas.Points.cs:107](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Points.cs#L107)

Fills a polygon described by tuple points.

Parameters

**points System.Collections.Generic.IReadOnlyList<System.ValueTuple<double, double>> required**

**color OfficeIMO.OfficeColor required**

FillPolygonsEvenOdd 2 overloads

`public void FillPolygonsEvenOdd(IReadOnlyList<IReadOnlyList<OfficePoint>> contours, OfficeColor color)` [#](#method-fillpolygonsevenodd-collections-generic-ireadonlylist-system-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-officecolor)

[OfficeRasterCanvas.cs:300](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L300)

Fills multiple polygon contours using the even-odd fill rule.

Parameters

**contours System.Collections.Generic.IReadOnlyList<System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>> required**

**color OfficeIMO.OfficeColor required**

`public void FillPolygonsEvenOdd(IReadOnlyList<IReadOnlyList<ValueTuple<double, double>>> contours, OfficeColor color)` [#](#method-fillpolygonsevenodd-collections-generic-ireadonlylist-system-collections-generic-ireadonlylist-system-valuetuple-system-double-system-double-officeimo-officecolor)

[OfficeRasterCanvas.Points.cs:118](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Points.cs#L118)

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>>> required**

**color OfficeIMO.OfficeColor required**

`public void FillPolygonsNonZero(IReadOnlyList<IReadOnlyList<OfficePoint>> contours, OfficeColor color)` [#](#method-fillpolygonsnonzero-collections-generic-ireadonlylist-system-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-officecolor)

[OfficeRasterCanvas.cs:309](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L309)

Fills multiple polygon contours using the non-zero winding fill rule.

Parameters

**contours System.Collections.Generic.IReadOnlyList<System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint>> required**

**color OfficeIMO.OfficeColor required**

`public void FillRadialGradientPolygon(IReadOnlyList<OfficePoint> points, OfficeRadialGradient gradient)` [#](#method-fillradialgradientpolygon-collections-generic-ireadonlylist-officeimo-drawing-officepoint-officeimo-drawing-officeradialgradient)

[OfficeRasterCanvas.cs:287](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L287)

Fills a polygon with a radial gradient.

Parameters

**points System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficePoint> required**

**gradient OfficeIMO.Drawing.OfficeRadialGradient required**

`public void FillRadialGradientRectangle(double x, double y, double width, double height, OfficeRadialGradient gradient)` [#](#method-fillradialgradientrectangle-double-double-double-double-officeimo-drawing-officeradialgradient)

[OfficeRasterCanvas.cs:146](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L146)

Fills a rectangle with a radial gradient.

Parameters

**x double required**

**y double required**

**width double required**

**height double required**

**gradient OfficeIMO.Drawing.OfficeRadialGradient required**

`public void FillRectangle(double x, double y, double width, double height, OfficeColor color)` [#](#method-fillrectangle-double-double-double-double-officeimo-officecolor)

[OfficeRasterCanvas.cs:133](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L133)

Fills a rectangle.

Parameters

**x double required**

**y double required**

**width double required**

**height double required**

**color OfficeIMO.OfficeColor required**

MeasureText 4 overloads

`public double MeasureText(string? text, OfficeFontInfo font)` [#](#method-measuretext-string-officeimo-drawing-officefontinfo)

[OfficeRasterCanvas.FontFaces.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.FontFaces.cs#L8)

Measures text using exact face attributes and the same fallback plan as painting.

Parameters

**text string? required**

**font OfficeIMO.Drawing.OfficeFontInfo required**

Returns

`double`

`public double MeasureText(string? text, double fontSize = 12)` [#](#method-measuretext-string-double)

[OfficeRasterCanvas.Text.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Text.cs#L11)

Measures text width with the managed font fallback used by this canvas.

Parameters

**text string? required**

**fontSize double = 12 optional**

Returns

`double`

`public double MeasureText(string? text, double fontSize, string? fontFamily)` [#](#method-measuretext-string-double-string)

[OfficeRasterCanvas.Text.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Text.cs#L16)

Measures text width with the requested font family when it can be resolved without platform font APIs.

Parameters

**text string? required**

**fontSize double required**

**fontFamily string? required**

Returns

`double`

`public double MeasureText(string? text, double fontSize, string? fontFamily, OfficeFontStyle style)` [#](#method-measuretext-string-double-string-officeimo-drawing-officefontstyle)

[OfficeRasterCanvas.Text.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Text.cs#L21)

Measures text width with a requested family and bold/italic scoped face when available.

Parameters

**text string? required**

**fontSize double required**

**fontFamily string? required**

**style OfficeIMO.Drawing.OfficeFontStyle required**

Returns

`double`

`public IDisposable PushClipPolygon(IReadOnlyList<OfficePoint> points)` [#](#method-pushclippolygon-collections-generic-ireadonlylist-officeimo-drawing-officepoint)

[OfficeRasterCanvas.Clipping.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Clipping.cs#L75)

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> required**

Polygon points in canvas coordinates.

Returns

`IDisposable` A disposable scope that restores the previous clip.

`public IDisposable PushClipPolygonsEvenOdd(IReadOnlyList<IReadOnlyList<OfficePoint>> contours)` [#](#method-pushclippolygonsevenodd-collections-generic-ireadonlylist-system-collections-generic-ireadonlylist-officeimo-drawing-officepoint)

[OfficeRasterCanvas.Clipping.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Clipping.cs#L87)

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>> required**

Closed contours in canvas coordinates.

Returns

`IDisposable` A disposable scope that restores the previous clip.

`public IDisposable PushClipPolygonsNonZero(IReadOnlyList<IReadOnlyList<OfficePoint>> contours)` [#](#method-pushclippolygonsnonzero-collections-generic-ireadonlylist-system-collections-generic-ireadonlylist-officeimo-drawing-officepoint)

[OfficeRasterCanvas.Clipping.cs:99](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Clipping.cs#L99)

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>> required**

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)` [#](#method-pushcliprectangle-double-double-double-double)

[OfficeRasterCanvas.Clipping.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.Clipping.cs#L32)

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 required**

Left edge of the clipping rectangle.

**y double required**

Top edge of the clipping rectangle.

**width double required**

Width of the clipping rectangle.

**height double required**

Height of the clipping rectangle.

Returns

`IDisposable` A disposable scope that restores the previous clip.

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public int Width { get; }` [#](#property-width)

[OfficeRasterCanvas.cs:112](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L112)

Canvas width in pixels.

`public int Height { get; }` [#](#property-height)

[OfficeRasterCanvas.cs:115](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/Raster/OfficeRasterCanvas.cs#L115)

Canvas height in pixels.

<!-- PowerForge markdown artifact sha256:08B97649F6381DCBB3872D3B3351BEB3741CE8F5387062353A72E330CFF7677E -->
