Interface IDrawingContextImpl
Defines the interface through which drawing occurs.
[Unstable]
public interface IDrawingContextImpl : IDisposable
- Inherited Members
- Extension Methods
Properties
Transform
Gets or sets the current transform of the drawing context.
Matrix Transform { get; set; }
Property Value
Methods
Clear(Color)
Clears the render target to the specified color.
void Clear(Color color)
Parameters
color
ColorThe color.
CreateLayer(PixelSize)
Creates a new IRenderTargetBitmapImpl that can be used as a render layer for the current render target.
IDrawingContextLayerImpl CreateLayer(PixelSize size)
Parameters
size
PixelSizeThe size of the layer in DIPs.
Returns
Remarks
Depending on the rendering backend used, a layer created via this method may be more performant than a standard render target bitmap. In particular the Direct2D backend has to do a format conversion each time a standard render target bitmap is rendered, but a layer created via this method has no such overhead.
DrawBitmap(IBitmapImpl, IBrush, Rect, Rect)
Draws a bitmap image.
void DrawBitmap(IBitmapImpl source, IBrush opacityMask, Rect opacityMaskRect, Rect destRect)
Parameters
source
IBitmapImplThe bitmap image.
opacityMask
IBrushThe opacity mask to draw with.
opacityMaskRect
RectThe destination rect for the opacity mask.
destRect
RectThe rect in the output to draw to.
DrawBitmap(IBitmapImpl, double, Rect, Rect)
Draws a bitmap image.
void DrawBitmap(IBitmapImpl source, double opacity, Rect sourceRect, Rect destRect)
Parameters
source
IBitmapImplThe bitmap image.
opacity
doubleThe opacity to draw with.
sourceRect
RectThe rect in the image to draw.
destRect
RectThe rect in the output to draw to.
DrawEllipse(IBrush?, IPen?, Rect)
Draws an ellipse with the specified Brush and Pen.
void DrawEllipse(IBrush? brush, IPen? pen, Rect rect)
Parameters
brush
IBrushThe brush used to fill the ellipse, or
null
for no fill.pen
IPenThe pen used to stroke the ellipse, or
null
for no stroke.rect
RectThe ellipse bounds.
Remarks
The brush and the pen can both be null. If the brush is null, then no fill is performed. If the pen is null, then no stoke is performed. If both the pen and the brush are null, then the drawing is not visible.
DrawGeometry(IBrush?, IPen?, IGeometryImpl)
Draws a geometry.
void DrawGeometry(IBrush? brush, IPen? pen, IGeometryImpl geometry)
Parameters
brush
IBrushThe fill brush.
pen
IPenThe stroke pen.
geometry
IGeometryImplThe geometry.
DrawGlyphRun(IBrush?, IGlyphRunImpl)
Draws a glyph run.
void DrawGlyphRun(IBrush? foreground, IGlyphRunImpl glyphRun)
Parameters
foreground
IBrushThe foreground.
glyphRun
IGlyphRunImplThe glyph run.
DrawLine(IPen?, Point, Point)
Draws a line.
void DrawLine(IPen? pen, Point p1, Point p2)
Parameters
pen
IPenThe stroke pen.
p1
PointThe first point of the line.
p2
PointThe second point of the line.
DrawRectangle(IBrush?, IPen?, RoundedRect, BoxShadows)
Draws a rectangle with the specified Brush and Pen.
void DrawRectangle(IBrush? brush, IPen? pen, RoundedRect rect, BoxShadows boxShadows = default)
Parameters
brush
IBrushThe brush used to fill the rectangle, or
null
for no fill.pen
IPenThe pen used to stroke the rectangle, or
null
for no stroke.rect
RoundedRectThe rectangle bounds.
boxShadows
BoxShadowsBox shadow effect parameters
Remarks
The brush and the pen can both be null. If the brush is null, then no fill is performed. If the pen is null, then no stoke is performed. If both the pen and the brush are null, then the drawing is not visible.
DrawRegion(IBrush?, IPen?, IPlatformRenderInterfaceRegion)
Draws the specified region with the specified Brush and Pen.
void DrawRegion(IBrush? brush, IPen? pen, IPlatformRenderInterfaceRegion region)
Parameters
brush
IBrushThe brush used to fill the rectangle, or
null
for no fill.pen
IPenThe pen used to stroke the rectangle, or
null
for no stroke.region
IPlatformRenderInterfaceRegionThe region to draw.
Remarks
The brush and the pen can both be null. If the brush is null, then no fill is performed. If the pen is null, then no stoke is performed. If both the pen and the brush are null, then the drawing is not visible.
GetFeature(Type)
Attempts to get an optional feature from the drawing context implementation.
object? GetFeature(Type t)
Parameters
t
Type
Returns
PopClip()
Pops the latest pushed clip rectangle.
void PopClip()
PopGeometryClip()
Pops the latest pushed geometry clip.
void PopGeometryClip()
PopLayer()
Pops the latest pushed intermediate surface layer.
void PopLayer()
PopOpacity()
Pops the latest pushed opacity value.
void PopOpacity()
PopOpacityMask()
Pops the latest pushed opacity mask.
void PopOpacityMask()
PopRenderOptions()
Pops the latest render options.
void PopRenderOptions()
PushClip(IPlatformRenderInterfaceRegion)
Pushes a clip region.
void PushClip(IPlatformRenderInterfaceRegion region)
Parameters
region
IPlatformRenderInterfaceRegionThe clip region
PushClip(Rect)
Pushes a clip rectangle.
void PushClip(Rect clip)
Parameters
clip
RectThe clip rectangle.
PushClip(RoundedRect)
Pushes a clip rounded rectangle.
void PushClip(RoundedRect clip)
Parameters
clip
RoundedRectThe clip rounded rectangle
PushGeometryClip(IGeometryImpl)
Pushes a clip geometry.
void PushGeometryClip(IGeometryImpl clip)
Parameters
clip
IGeometryImplThe clip geometry.
PushLayer(Rect)
Enforces rendering to happen on an intermediate surface
void PushLayer(Rect bounds)
Parameters
bounds
Rect
PushOpacity(double, Rect?)
Pushes an opacity value.
void PushOpacity(double opacity, Rect? bounds)
Parameters
PushOpacityMask(IBrush, Rect)
Pushes an opacity mask.
void PushOpacityMask(IBrush mask, Rect bounds)
Parameters
PushRenderOptions(RenderOptions)
Pushes render options.
void PushRenderOptions(RenderOptions renderOptions)
Parameters
renderOptions
RenderOptionsThe render options.