Click or drag to resize
CanvasDrawingSession Class
Drawing sessions are used to issue graphics drawing commands. This is the main way to draw things onto a canvas.
Inheritance Hierarchy
SystemObject
  Microsoft.Graphics.CanvasCanvasDrawingSession

Namespace:  Microsoft.Graphics.Canvas
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public sealed class CanvasDrawingSession : IDisposable, 
	ICanvasResourceCreatorWithDpi, ICanvasResourceCreator

The CanvasDrawingSession type exposes the following members.

Properties
  NameDescription
Public propertyAntialiasing
Enables or disables primitive edge antialiasing for this drawing session.
Public propertyBlend
Sets the blend mode for this drawing session.
Public propertyDevice
Gets the underlying device used by this drawing session.
Public propertyDpi
Gets the dots-per-inch (DPI) of this drawing session.
Public propertyEffectBufferPrecision
Specifies the default precision used for intermediate buffers when drawing image effects.
Public propertyEffectTileSize
Specifies the tile size used when drawing image effects.
Public propertyTextAntialiasing
Sets the text antialiasing mode for this drawing session.
Public propertyTextRenderingParameters
Describes advanced options which are applied when text is being drawn.
Public propertyTransform
Sets the transform matrix that will be applied to subsequent drawing calls on this drawing session.
Public propertyUnits
Sets what units are used to specifiy coordinates for this drawing session.
Top
Methods
  NameDescription
Public methodClear(Color)
Clears to the specified color.
Public methodClear(Vector4)
Clears to the specified high-dynamic-range color.
Public methodConvertDipsToPixels
Converts units from device independent pixels (DIPs) to physical pixels based on the DPI of this drawing session.
Public methodConvertPixelsToDips
Converts units from physical pixels to device independent pixels (DIPs) based on the DPI of this drawing session.
Public methodCreateLayer(Single)
Creates a layer that will blend its contents using the specified opacity.
Public methodCreateLayer(ICanvasBrush)
Creates a layer that will blend its contents using the specified opacity mask brush (which could contain a bitmap or gradient).
Public methodCreateLayer(Single, CanvasGeometry)
Creates a layer that will clip its contents to an arbitrarily complex region defined by a geometry, and blend using the specified opacity.
Public methodCreateLayer(Single, Rect)
Creates a layer that will clip its contents to a rectangle, and blend using the specified opacity.
Public methodCreateLayer(ICanvasBrush, CanvasGeometry)
Creates a layer that will clip its contents to an arbitrarily complex region defined by a geometry, and blend using the specified opacity mask brush.
Public methodCreateLayer(ICanvasBrush, Rect)
Creates a layer that will clip its contents to a rectangle, and blend using the specified opacity mask brush.
Public methodCreateLayer(Single, CanvasGeometry, Matrix3x2)
Creates a layer that will clip its contents to an arbitrarily complex region defined by a geometry, and blend using the specified opacity.
Public methodCreateLayer(ICanvasBrush, CanvasGeometry, Matrix3x2)
Creates a layer that will clip its contents to an arbitrarily complex region defined by a geometry, and blend the specified opacity mask brush.
Public methodCreateLayer(Single, ICanvasBrush, Rect, CanvasGeometry, Matrix3x2, CanvasLayerOptions)
Creates a layer that will clip its contents to a rectangle and/or geometry region, and blend using the specified opacity and/or opacity mask brush.
Public methodCreateSpriteBatch
[Win10_10586] Creates a new sprite batch for efficiently drawing many CanvasBitmaps.
Public methodCreateSpriteBatch(CanvasSpriteSortMode)
[Win10_10586] Creates a new sprite batch for efficiently drawing many CanvasBitmaps with a specific sort mode.
Public methodCreateSpriteBatch(CanvasSpriteSortMode, CanvasImageInterpolation)
[Win10_10586] Creates a new sprite batch for efficiently drawing many CanvasBitmaps with a specific sort mode and interpolation.
Public methodCreateSpriteBatch(CanvasSpriteSortMode, CanvasImageInterpolation, CanvasSpriteOptions)
[Win10_10586] Creates a new sprite batch for efficiently drawing many CanvasBitmaps with a specific sort mode, interpolation and options.
Public methodDispose
Releases all resources used by the CanvasDrawingSession.
Public methodDrawCachedGeometry(CanvasCachedGeometry, ICanvasBrush)
Draws a cached geometry relative to the origin, using a brush to define the color.
Public methodDrawCachedGeometry(CanvasCachedGeometry, Color)
Draws a cached geometry relative to the origin and with the specified color.
Public methodDrawCachedGeometry(CanvasCachedGeometry, Vector2, ICanvasBrush)
Draws a cached geometry relative to the specified position, using a brush to define the color.
Public methodDrawCachedGeometry(CanvasCachedGeometry, Vector2, Color)
Draws a cached geometry relative to the specified position and with the specified color.
Public methodDrawCachedGeometry(CanvasCachedGeometry, Single, Single, ICanvasBrush)
Draws a cached geometry relative to the specified position, using a brush to define the color.
Public methodDrawCachedGeometry(CanvasCachedGeometry, Single, Single, Color)
Draws a cached geometry relative to the specified position and with the specified color.
Public methodDrawCircle(Vector2, Single, ICanvasBrush)
Draws a circle of single unit stroke width, using a brush to define the color.
Public methodDrawCircle(Vector2, Single, Color)
Draws a circle of single unit stroke width and the specified color.
Public methodDrawCircle(Single, Single, Single, ICanvasBrush)
Draws a circle of single unit stroke width, using a brush to define the color.
Public methodDrawCircle(Single, Single, Single, Color)
Draws a circle of single unit stroke width and the specified color.
Public methodDrawCircle(Vector2, Single, ICanvasBrush, Single)
Draws a circle of the specified stroke width, using a brush to define the color.
Public methodDrawCircle(Vector2, Single, Color, Single)
Draws a circle of the specified stroke width and color.
Public methodDrawCircle(Single, Single, Single, ICanvasBrush, Single)
Draws a circle of the specified stroke width, using a brush to define the color.
Public methodDrawCircle(Single, Single, Single, Color, Single)
Draws a circle of the specified stroke width and color.
Public methodDrawCircle(Vector2, Single, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a circle of the specified stroke width, using a brush to define the color and with a custom stroke style.
Public methodDrawCircle(Vector2, Single, Color, Single, CanvasStrokeStyle)
Draws a circle of the specified stroke width and color, with a custom stroke style.
Public methodDrawCircle(Single, Single, Single, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a circle of the specified stroke width, using a brush to define the color and with a custom stroke style.
Public methodDrawCircle(Single, Single, Single, Color, Single, CanvasStrokeStyle)
Draws a circle of the specified stroke width and color, with a custom stroke style.
Public methodDrawEllipse(Vector2, Single, Single, ICanvasBrush)
It's like a circle, but squashed. Using a brush to define the color.
Public methodDrawEllipse(Vector2, Single, Single, Color)
It's like a circle, but squashed.
Public methodDrawEllipse(Single, Single, Single, Single, ICanvasBrush)
It's like a circle, but squashed. Using a brush to define the color.
Public methodDrawEllipse(Single, Single, Single, Single, Color)
It's like a circle, but squashed.
Public methodDrawEllipse(Vector2, Single, Single, ICanvasBrush, Single)
It's like a circle, but squashed. Using a brush to define the color.
Public methodDrawEllipse(Vector2, Single, Single, Color, Single)
It's like a circle, but squashed.
Public methodDrawEllipse(Single, Single, Single, Single, ICanvasBrush, Single)
It's like a circle, but squashed. Using a brush to define the color.
Public methodDrawEllipse(Single, Single, Single, Single, Color, Single)
It's like a circle, but squashed.
Public methodDrawEllipse(Vector2, Single, Single, ICanvasBrush, Single, CanvasStrokeStyle)
It's like a circle, but squashed. Using a brush to define the color and with a custom stroke style.
Public methodDrawEllipse(Vector2, Single, Single, Color, Single, CanvasStrokeStyle)
It's like a circle, but squashed.
Public methodDrawEllipse(Single, Single, Single, Single, ICanvasBrush, Single, CanvasStrokeStyle)
It's like a circle, but squashed. Using a brush to define the color and with a custom stroke style.
Public methodDrawEllipse(Single, Single, Single, Single, Color, Single, CanvasStrokeStyle)
It's like a circle, but squashed.
Public methodDrawGeometry(CanvasGeometry, ICanvasBrush)
Draws a geometry relative to the origin, with a single unit stroke width, and using a brush to define the color.
Public methodDrawGeometry(CanvasGeometry, Color)
Draws a geometry relative to the origin, with a single unit stroke width and the specified color.
Public methodDrawGeometry(CanvasGeometry, ICanvasBrush, Single)
Draws a geometry relative to the origin, with the specified stroke width, and using a brush to define the color.
Public methodDrawGeometry(CanvasGeometry, Vector2, ICanvasBrush)
Draws a geometry relative to the specified position, with a single unit stroke width, and using a brush to define the color.
Public methodDrawGeometry(CanvasGeometry, Vector2, Color)
Draws a geometry relative to the specified position, with a single unit stroke width and the specified color.
Public methodDrawGeometry(CanvasGeometry, Color, Single)
Draws a geometry relative to the origin, with the specified stroke width and color.
Public methodDrawGeometry(CanvasGeometry, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a geometry relative to the origin, with the specified stroke width and stroke style, and using a brush to define the color.
Public methodDrawGeometry(CanvasGeometry, Vector2, ICanvasBrush, Single)
Draws a geometry relative to the specified position, with the specified stroke width, and using a brush to define the color.
Public methodDrawGeometry(CanvasGeometry, Vector2, Color, Single)
Draws a geometry relative to the specified position, with the specified stroke width and color.
Public methodDrawGeometry(CanvasGeometry, Single, Single, ICanvasBrush)
Draws a geometry relative to the specified position, with a single unit stroke width, and using a brush to define the color.
Public methodDrawGeometry(CanvasGeometry, Single, Single, Color)
Draws a geometry relative to the specified position, with a single unit stroke width and the specified color.
Public methodDrawGeometry(CanvasGeometry, Color, Single, CanvasStrokeStyle)
Draws a geometry relative to the origin, with the specified stroke width, stroke style, and color.
Public methodDrawGeometry(CanvasGeometry, Vector2, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a geometry relative to the specified position, with the specified stroke width and stroke style, and using a brush to define the color.
Public methodDrawGeometry(CanvasGeometry, Vector2, Color, Single, CanvasStrokeStyle)
Draws a geometry relative to the specified position, with the specified stroke width, stroke style, and color.
Public methodDrawGeometry(CanvasGeometry, Single, Single, ICanvasBrush, Single)
Draws a geometry relative to the specified position, with the specified stroke width, and using a brush to define the color.
Public methodDrawGeometry(CanvasGeometry, Single, Single, Color, Single)
Draws a geometry relative to the specified position, with the specified stroke width and color.
Public methodDrawGeometry(CanvasGeometry, Single, Single, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a geometry relative to the specified position, with the specified stroke width and stroke style, and using a brush to define the color.
Public methodDrawGeometry(CanvasGeometry, Single, Single, Color, Single, CanvasStrokeStyle)
Draws a geometry relative to the specified position, with the specified stroke width, stroke style, and color.
Public methodDrawGlyphRun(Vector2, CanvasFontFace, Single, CanvasGlyph, Boolean, UInt32, ICanvasBrush)
Draws a sequence of text characters which share the same formatting.
Public methodDrawGlyphRun(Vector2, CanvasFontFace, Single, CanvasGlyph, Boolean, UInt32, ICanvasBrush, CanvasTextMeasuringMode)
Draws a sequence of text characters which share the same formatting.
Public methodDrawGlyphRun(Vector2, CanvasFontFace, Single, CanvasGlyph, Boolean, UInt32, ICanvasBrush, CanvasTextMeasuringMode, String, String, Int32, UInt32)
Draws a sequence of text characters which share the same formatting.
Public methodDrawGradientMesh(CanvasGradientMesh)
[Win10] Draws a gradient mesh, relative to the origin.
Public methodDrawGradientMesh(CanvasGradientMesh, Vector2)
[Win10] Draws a gradient mesh, relative to the specified position.
Public methodDrawGradientMesh(CanvasGradientMesh, Single, Single)
[Win10] Draws a gradient mesh, relative to the specified position.
Public methodDrawImage(ICanvasImage)
Draws an image.
Public methodDrawImage(CanvasBitmap, Rect)
Draws a bitmap.
Public methodDrawImage(ICanvasImage, Vector2)
Draws an image.
Public methodDrawImage(ICanvasImage, Vector2, Rect)
Draws an image.
Public methodDrawImage(ICanvasImage, Single, Single)
Draws an image.
Public methodDrawImage(ICanvasImage, Rect, Rect)
Draws an image.
Public methodDrawImage(ICanvasImage, Vector2, Rect, Single)
Draws an image.
Public methodDrawImage(ICanvasImage, Single, Single, Rect)
Draws an image.
Public methodDrawImage(ICanvasImage, Rect, Rect, Single)
Draws an image.
Public methodDrawImage(ICanvasImage, Vector2, Rect, Single, CanvasImageInterpolation)
Draws an image.
Public methodDrawImage(ICanvasImage, Single, Single, Rect, Single)
Draws an image.
Public methodDrawImage(ICanvasImage, Rect, Rect, Single, CanvasImageInterpolation)
Draws an image.
Public methodDrawImage(CanvasBitmap, Vector2, Rect, Single, CanvasImageInterpolation, Matrix4x4)
Draws a bitmap.
Public methodDrawImage(CanvasBitmap, Rect, Rect, Single, CanvasImageInterpolation, Matrix4x4)
Draws a bitmap.
Public methodDrawImage(ICanvasImage, Vector2, Rect, Single, CanvasImageInterpolation, CanvasComposite)
Draws an image.
Public methodDrawImage(ICanvasImage, Single, Single, Rect, Single, CanvasImageInterpolation)
Draws an image.
Public methodDrawImage(ICanvasImage, Rect, Rect, Single, CanvasImageInterpolation, CanvasComposite)
Draws an image.
Public methodDrawImage(CanvasBitmap, Single, Single, Rect, Single, CanvasImageInterpolation, Matrix4x4)
Draws a bitmap.
Public methodDrawImage(ICanvasImage, Single, Single, Rect, Single, CanvasImageInterpolation, CanvasComposite)
Draws an image.
Public methodDrawInk(IEnumerableInkStroke)
[Win10] Draws a collection of ink strokes.
Public methodDrawInk(IEnumerableInkStroke, Boolean)
[Win10] Draws a collection of ink strokes.
Public methodDrawLine(Vector2, Vector2, ICanvasBrush)
Draws a line of single unit width, using a brush to define the color.
Public methodDrawLine(Vector2, Vector2, Color)
Draws a line of single unit width and the specified color.
Public methodDrawLine(Vector2, Vector2, ICanvasBrush, Single)
Draws a line of the specified width, using a brush to define the color.
Public methodDrawLine(Vector2, Vector2, Color, Single)
Draws a line of the specified width and color.
Public methodDrawLine(Single, Single, Single, Single, ICanvasBrush)
Draws a line of single unit width, using a brush to define the color.
Public methodDrawLine(Single, Single, Single, Single, Color)
Draws a line of single unit width and the specified color.
Public methodDrawLine(Vector2, Vector2, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a line of the specified width, using a brush to define the color and with a custom stroke style.
Public methodDrawLine(Vector2, Vector2, Color, Single, CanvasStrokeStyle)
Draws a line of the specified width and color, with a custom stroke style.
Public methodDrawLine(Single, Single, Single, Single, ICanvasBrush, Single)
Draws a line of the specified width, using a brush to define the color.
Public methodDrawLine(Single, Single, Single, Single, Color, Single)
Draws a line of the specified width and color.
Public methodDrawLine(Single, Single, Single, Single, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a line of the specified width, using a brush to define the color and with a custom stroke style.
Public methodDrawLine(Single, Single, Single, Single, Color, Single, CanvasStrokeStyle)
Draws a line of the specified width and color, with a custom stroke style.
Public methodDrawRectangle(Rect, ICanvasBrush)
Draws a rectangle of single unit stroke width, using a brush to define the color.
Public methodDrawRectangle(Rect, Color)
Draws a rectangle of single unit stroke width and the specified color.
Public methodDrawRectangle(Rect, ICanvasBrush, Single)
Draws a rectangle of the specified stroke width, using a brush to define the color.
Public methodDrawRectangle(Rect, Color, Single)
Draws a rectangle of the specified stroke width and color.
Public methodDrawRectangle(Rect, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a rectangle of the specified stroke width, using a brush to define the color and with a custom stroke style.
Public methodDrawRectangle(Rect, Color, Single, CanvasStrokeStyle)
Draws a rectangle of the specified stroke width and color, with a custom stroke style.
Public methodDrawRectangle(Single, Single, Single, Single, ICanvasBrush)
Draws a rectangle of single unit stroke width, using a brush to define the color.
Public methodDrawRectangle(Single, Single, Single, Single, Color)
Draws a rectangle of single unit stroke width and the specified color.
Public methodDrawRectangle(Single, Single, Single, Single, ICanvasBrush, Single)
Draws a rectangle of the specified stroke width, using a brush to define the color.
Public methodDrawRectangle(Single, Single, Single, Single, Color, Single)
Draws a rectangle of the specified stroke width and color.
Public methodDrawRectangle(Single, Single, Single, Single, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a rectangle of the specified stroke width, using a brush to define the color and with a custom stroke style.
Public methodDrawRectangle(Single, Single, Single, Single, Color, Single, CanvasStrokeStyle)
Draws a rectangle of the specified stroke width and color, with a custom stroke style.
Public methodDrawRoundedRectangle(Rect, Single, Single, ICanvasBrush)
Draws a rounded rectangle of single unit stroke width, using a brush to define the color.
Public methodDrawRoundedRectangle(Rect, Single, Single, Color)
Draws a rounded rectangle of single unit stroke width and the specified color.
Public methodDrawRoundedRectangle(Rect, Single, Single, ICanvasBrush, Single)
Draws a rounded rectangle of the specified stroke width, using a brush to define the color.
Public methodDrawRoundedRectangle(Rect, Single, Single, Color, Single)
Draws a rounded rectangle of the specified stroke width and color.
Public methodDrawRoundedRectangle(Rect, Single, Single, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a rounded rectangle of the specified stroke width, using a brush to define the color and with a custom stroke style.
Public methodDrawRoundedRectangle(Rect, Single, Single, Color, Single, CanvasStrokeStyle)
Draws a rounded rectangle of the specified stroke width and color, with a custom stroke style.
Public methodDrawRoundedRectangle(Single, Single, Single, Single, Single, Single, ICanvasBrush)
Draws a rounded rectangle of single unit stroke width, using a brush to define the color.
Public methodDrawRoundedRectangle(Single, Single, Single, Single, Single, Single, Color)
Draws a rounded rectangle of single unit stroke width and the specified color.
Public methodDrawRoundedRectangle(Single, Single, Single, Single, Single, Single, ICanvasBrush, Single)
Draws a rounded rectangle of the specified stroke width, using a brush to define the color.
Public methodDrawRoundedRectangle(Single, Single, Single, Single, Single, Single, Color, Single)
Draws a rounded rectangle of the specified stroke width and color.
Public methodDrawRoundedRectangle(Single, Single, Single, Single, Single, Single, ICanvasBrush, Single, CanvasStrokeStyle)
Draws a rounded rectangle of the specified stroke width, using a brush to define the color and with a custom stroke style.
Public methodDrawRoundedRectangle(Single, Single, Single, Single, Single, Single, Color, Single, CanvasStrokeStyle)
Draws a rounded rectangle of the specified stroke width and color, with a custom stroke style.
Public methodDrawSvg(CanvasSvgDocument, Size)
[Experimental] [Win10_15063] Draws an SVG document with the specified viewport size at the origin.
Public methodDrawSvg(CanvasSvgDocument, Size, Vector2)
[Experimental] [Win10_15063] Draws an SVG document with the specified viewport size, at the specified coordinate location.
Public methodDrawSvg(CanvasSvgDocument, Size, Single, Single)
[Experimental] [Win10_15063] Draws an SVG document with the specified viewport size, at the specified coordinates.
Public methodDrawText(String, Vector2, Color)
Draws text using a default font.
Public methodDrawText(String, Vector2, ICanvasBrush, CanvasTextFormat)
Draws text at the specified position, using a brush to define the color.
Public methodDrawText(String, Vector2, Color, CanvasTextFormat)
Draws text at the specified position.
Public methodDrawText(String, Single, Single, Color)
Draws text using a default font.
Public methodDrawText(String, Rect, ICanvasBrush, CanvasTextFormat)
Draws text inside the specified rectangle, using a brush to define the color.
Public methodDrawText(String, Rect, Color, CanvasTextFormat)
Draws text inside the specified rectangle.
Public methodDrawText(String, Single, Single, ICanvasBrush, CanvasTextFormat)
Draws text at the specified position, using a brush to define the color.
Public methodDrawText(String, Single, Single, Color, CanvasTextFormat)
Draws text at the specified position.
Public methodDrawText(String, Single, Single, Single, Single, ICanvasBrush, CanvasTextFormat)
Draws text inside the specified rectangle, using a brush to define the color.
Public methodDrawText(String, Single, Single, Single, Single, Color, CanvasTextFormat)
Draws text inside the specified rectangle.
Public methodDrawTextLayout(CanvasTextLayout, Vector2, ICanvasBrush)
Draws a text layout, using a brush to define the color.
Public methodDrawTextLayout(CanvasTextLayout, Vector2, Color)
Draws a text layout with the specified color.
Public methodDrawTextLayout(CanvasTextLayout, Single, Single, ICanvasBrush)
Draws a text layout, using a brush to define the color.
Public methodDrawTextLayout(CanvasTextLayout, Single, Single, Color)
Draws a text layout with the specified color.
Public methodFillCircle(Vector2, Single, ICanvasBrush)
Fills the interior of a circle, using a brush to define the color.
Public methodFillCircle(Vector2, Single, Color)
Fills the interior of a circle with the specified color.
Public methodFillCircle(Single, Single, Single, ICanvasBrush)
Fills the interior of a circle, using a brush to define the color.
Public methodFillCircle(Single, Single, Single, Color)
Fills the interior of a circle with the specified color.
Public methodFillEllipse(Vector2, Single, Single, ICanvasBrush)
Fills the interior of an ellipse, using a brush to define the color.
Public methodFillEllipse(Vector2, Single, Single, Color)
Fills the interior of a ellipse with the specified color.
Public methodFillEllipse(Single, Single, Single, Single, ICanvasBrush)
Fills the interior of an ellipse, using a brush to define the color.
Public methodFillEllipse(Single, Single, Single, Single, Color)
Fills the interior of a ellipse with the specified color.
Public methodFillGeometry(CanvasGeometry, ICanvasBrush)
Fills a geometry relative to the origin, using a brush to define the color.
Public methodFillGeometry(CanvasGeometry, Color)
Fills a geometry relative to the origin with the specified color.
Public methodFillGeometry(CanvasGeometry, ICanvasBrush, ICanvasBrush)
Fills a geometry relative to the origin, using a brush to define the color and a second brush to specify an opacity mask.
Public methodFillGeometry(CanvasGeometry, Vector2, ICanvasBrush)
Fills a geometry relative to the specified position, using a brush to define the color.
Public methodFillGeometry(CanvasGeometry, Vector2, Color)
Fills a geometry relative to the specified position with the specified color.
Public methodFillGeometry(CanvasGeometry, Vector2, ICanvasBrush, ICanvasBrush)
Fills a geometry relative to the specified position, using a brush to define the color and a second brush to specify an opacity mask.
Public methodFillGeometry(CanvasGeometry, Single, Single, ICanvasBrush)
Fills a geometry relative to the specified position, using a brush to define the color.
Public methodFillGeometry(CanvasGeometry, Single, Single, Color)
Fills a geometry relative to the specified position with the specified color.
Public methodFillGeometry(CanvasGeometry, Single, Single, ICanvasBrush, ICanvasBrush)
Fills a geometry relative to the specified position, using a brush to define the color and a second brush to specify an opacity mask.
Public methodFillRectangle(Rect, ICanvasBrush)
Fills the interior of a rectangle, using a brush to define the color.
Public methodFillRectangle(Rect, Color)
Fills the interior of a rectangle with the specified color.
Public methodFillRectangle(Rect, ICanvasBrush, ICanvasBrush)
Fills the interior of a rectangle, using a brush to define the color and a second brush to specify an opacity mask.
Public methodFillRectangle(Single, Single, Single, Single, ICanvasBrush)
Fills the interior of a rectangle, using a brush to define the color.
Public methodFillRectangle(Single, Single, Single, Single, Color)
Fills the interior of a rectangle with the specified color.
Public methodFillRectangle(Single, Single, Single, Single, ICanvasBrush, ICanvasBrush)
Fills the interior of a rectangle, using a brush to define the color and a second brush to specify an opacity mask.
Public methodFillRoundedRectangle(Rect, Single, Single, ICanvasBrush)
Fills the interior of a rounded rectangle, using a brush to define the color.
Public methodFillRoundedRectangle(Rect, Single, Single, Color)
Fills the interior of a rounded rectangle with the specified color.
Public methodFillRoundedRectangle(Single, Single, Single, Single, Single, Single, ICanvasBrush)
Fills the interior of a rounded rectangle, using a brush to define the color.
Public methodFillRoundedRectangle(Single, Single, Single, Single, Single, Single, Color)
Fills the interior of a rounded rectangle with the specified color.
Public methodFlush
Sends any pending drawing commands to the graphics device.
Top
Remarks

For best performance, graphics drawing commands need to be batched into groups so the GPU hardware can process as many operations as possible in parallel. Win2D achieves this through the CanvasDrawingSession API. A drawing session represents an active batch of commands that are in the process of being generated. Use CanvasDrawingSession's various methods to indicate what you want to draw, then when you are done close the CanvasDrawingSession. This will finalize the command batch, optimize it and submit it to the GPU hardware to be carried out. No actual rendering work is performed on the GPU until the CanvasDrawingSession is closed.

CanvasDrawingSession implements the IClosable interface; therefore, you close it by explicitly calling the Close method (which is projected into .NET as Dispose). If you are using C#, you can also use the 'using' statement. If you are using C++/CX, Close is accessed via the 'delete' keyword.

Drawing sessions can be obtained in various different ways. Most often, you should use the one that is passed in to the CanvasControl.Draw or CanvasAnimatedControl.Draw event handler. A drawing session obtained in this way is automatically closed after the event handler returns, so there is no need for you to do anything else. However, if you explicitly created a drawing session you must close it yourself when you are done drawing to it.

When using Direct2D interop, this Win2D class corresponds to the Direct2D interface ID2D1DeviceContext1.

See Also