Table of Contents

Interface CommandSink

Namespace
SharpDX.Direct2D1
Assembly
SharpDX.Direct2D1.dll
[Guid("54d7898a-a061-40a7-bec7-e465bcba2c4f")]
public interface CommandSink : IUnknown, ICallbackable, IDisposable
Inherited Members

Properties

AntialiasMode

Sets the antialias mode.

AntialiasMode AntialiasMode { set; }

Property Value

AntialiasMode

PrimitiveBlend

Sets the blending for primitives.

PrimitiveBlend PrimitiveBlend { set; }

Property Value

PrimitiveBlend

TextAntialiasMode

Sets the text antialias mode.

TextAntialiasMode TextAntialiasMode { set; }

Property Value

TextAntialiasMode

TextRenderingParams

Sets the parameters for text rendering.

RenderingParams TextRenderingParams { set; }

Property Value

RenderingParams

Transform

Sets the matrix transform.

RawMatrix3x2 Transform { set; }

Property Value

RawMatrix3x2

Remarks

The transform will be applied to the corresponding device context.

UnitMode

Sets the unit mode

UnitMode UnitMode { set; }

Property Value

UnitMode

Methods

BeginDraw()

Begins a draw sequence.

void BeginDraw()

Clear(RawColor4?)

[This documentation is preliminary and is subject to change.]

void Clear(RawColor4? color = null)

Parameters

color RawColor4?

The color to which the command sink should be cleared.

Remarks

The clear color is restricted by the currently selected clip and layer bounds.If no color is specified, the color should be interpreted by context. Examples include but are not limited to:Transparent black for a premultiplied bitmap target. Opaque black for an ignore bitmap target. Containing no content (or white) for a printer page.

DrawBitmap(Bitmap, RawRectangleF?, float, InterpolationMode, RawRectangleF?, RawMatrix?)

No documentation.

void DrawBitmap(Bitmap bitmap, RawRectangleF? destinationRectangle, float opacity, InterpolationMode interpolationMode, RawRectangleF? sourceRectangle, RawMatrix? erspectiveTransformRef)

Parameters

bitmap Bitmap

No documentation.

destinationRectangle RawRectangleF?

No documentation.

opacity float

No documentation.

interpolationMode InterpolationMode

No documentation.

sourceRectangle RawRectangleF?

No documentation.

erspectiveTransformRef RawMatrix?

No documentation.

DrawGdiMetafile(GdiMetafile, RawVector2?)

No documentation.

void DrawGdiMetafile(GdiMetafile gdiMetafile, RawVector2? targetOffset)

Parameters

gdiMetafile GdiMetafile

No documentation.

targetOffset RawVector2?

No documentation.

DrawGeometry(Geometry, Brush, float, StrokeStyle)

[This documentation is preliminary and is subject to change.]

void DrawGeometry(Geometry geometry, Brush brush, float strokeWidth, StrokeStyle strokeStyle)

Parameters

geometry Geometry

The geometry to be stroked.

brush Brush

The brush that will be used to fill the stroked geometry.

strokeWidth float

The width of the stroke.

strokeStyle StrokeStyle

The style of the stroke.

Remarks

You must convert ellipses and rounded rectangles to the corresponding ellipse and rounded rectangle geometries before calling into the DrawGeometry method.Additional ReferencesID2D1CommandList::Stream, DrawGeometry(Geometry, Brush)RequirementsMinimum supported operating systemSame as Interface / Class Highest IRQL levelN/A (user mode) Callable from DlllMain()No Callable from services and session 0Yes Callable from UI threadYes?

DrawGlyphRun(RawVector2, GlyphRun, GlyphRunDescription, Brush, MeasuringMode)

[This documentation is preliminary and is subject to change.]

void DrawGlyphRun(RawVector2 baselineOrigin, GlyphRun glyphRun, GlyphRunDescription glyphRunDescription, Brush foregroundBrush, MeasuringMode measuringMode)

Parameters

baselineOrigin RawVector2

The sequence of glyphs to be sent.

glyphRun GlyphRun

Additional non-rendering information about the glyphs.

glyphRunDescription GlyphRunDescription

The brush used to fill the glyphs.

foregroundBrush Brush

The measuring mode to apply to the glyphs.

measuringMode MeasuringMode

No documentation.

DrawImage(Image, RawVector2?, RawRectangleF?, InterpolationMode, CompositeMode)

[This documentation is preliminary and is subject to change.]

void DrawImage(Image image, RawVector2? targetOffset, RawRectangleF? imageRectangle, InterpolationMode interpolationMode, CompositeMode compositeMode)

Parameters

image Image

The image to be drawn to the command sink.

targetOffset RawVector2?

This defines the offset in the destination space that the image will be rendered to. The entire logical extent of the image will be rendered to the corresponding destination. If not specified, the destination origin will be (0, 0). The top-left corner of the image will be mapped to the target offset. This will not necessarily be the origin.

imageRectangle RawRectangleF?

The corresponding rectangle in the image space will be mapped to the provided origins when processing the image.

interpolationMode InterpolationMode

The interpolation mode that will be used to scale the image if necessary.

compositeMode CompositeMode

If specified, the composite mode that will be applied to the limits of the currently selected clip.

Remarks

Because the image can itself be a command list or contain an effect graph that in turn contains a command list, this method can result in recursive processing.

DrawLine(RawVector2, RawVector2, Brush, float, StrokeStyle)

[This documentation is preliminary and is subject to change.]

void DrawLine(RawVector2 point0, RawVector2 point1, Brush brush, float strokeWidth, StrokeStyle strokeStyle)

Parameters

point0 RawVector2

The start point of the line.

point1 RawVector2

The end point of the line.

brush Brush

The brush used to fill the line.

strokeWidth float

The width of the stroke to fill the line.

strokeStyle StrokeStyle

The style of the stroke. If not specified, the stroke is solid.

Remarks

Additional References

DrawRectangle(RawRectangleF, Brush, float, StrokeStyle)

No documentation.

void DrawRectangle(RawRectangleF rect, Brush brush, float strokeWidth, StrokeStyle strokeStyle)

Parameters

rect RawRectangleF

No documentation.

brush Brush

No documentation.

strokeWidth float

No documentation.

strokeStyle StrokeStyle

No documentation.

EndDraw()

Ends a draw sequence.

void EndDraw()

FillGeometry(Geometry, Brush, Brush)

[This documentation is preliminary and is subject to change.]

void FillGeometry(Geometry geometry, Brush brush, Brush opacityBrush)

Parameters

geometry Geometry

The geometry that should be filled.

brush Brush

The primary brush used to fill the geometry.

opacityBrush Brush

A brush whose alpha channel is used to modify the opacity of the primary fill brush.

Remarks

If the opacity brush is specified, the primary brush will be a bitmap brush fixed on both the x-axis and the y-axis.Ellipses and rounded rectangles are converted to the corresponding geometry before being passed to FillGeometry.

FillMesh(Mesh, Brush)

[This documentation is preliminary and is subject to change.]

void FillMesh(Mesh mesh, Brush brush)

Parameters

mesh Mesh

The mesh object to be filled.

brush Brush

The brush with which to fill the mesh.

FillOpacityMask(Bitmap, Brush, RawRectangleF?, RawRectangleF?)

[This documentation is preliminary and is subject to change.]

void FillOpacityMask(Bitmap opacityMask, Brush brush, RawRectangleF? destinationRectangle, RawRectangleF? sourceRectangle)

Parameters

opacityMask Bitmap

The bitmap whose alpha channel will be sampled to define the opacity mask.

brush Brush

The brush with which to fill the mask.

destinationRectangle RawRectangleF?

The type of content that the mask represents.

sourceRectangle RawRectangleF?

The destination rectangle in which to fill the mask. If not specified, this is the origin.

Remarks

The opacity mask bitmap must be considered to be clamped on each axis.

FillRectangle(RawRectangleF, Brush)

[This documentation is preliminary and is subject to change.]

void FillRectangle(RawRectangleF rect, Brush brush)

Parameters

rect RawRectangleF

The rectangle to fill.

brush Brush

The brush with which to fill the rectangle.

PopAxisAlignedClip()

[This documentation is preliminary and is subject to change.]

void PopAxisAlignedClip()

PopLayer()

No documentation.

void PopLayer()

PushAxisAlignedClip(RawRectangleF, AntialiasMode)

[This documentation is preliminary and is subject to change.]

void PushAxisAlignedClip(RawRectangleF clipRect, AntialiasMode antialiasMode)

Parameters

clipRect RawRectangleF

The rectangle that defines the clip.

antialiasMode AntialiasMode

Whether the given clip should be antialiased.

Remarks

If the current world transform is not preserving the axis, clipRectangle is transformed and the bounds of the transformed rectangle are used instead.

PushLayer(ref LayerParameters1, Layer)

No documentation.

void PushLayer(ref LayerParameters1 layerParameters1, Layer layer)

Parameters

layerParameters1 LayerParameters1

No documentation.

layer Layer

No documentation.

SetTags(long, long)

Sets tags.

void SetTags(long tag1, long tag2)

Parameters

tag1 long
tag2 long