Class DeviceContext1
[Guid("d37f57e4-6908-459f-a199-e72f24f79987")]
public class DeviceContext1 : DeviceContext
- Inheritance
-
DeviceContext1
- Derived
- Inherited Members
Constructors
DeviceContext1(Device1, DeviceContextOptions)
Initializes a new instance of the DeviceContext1 class using an existing Device1.
public DeviceContext1(Device1 device, DeviceContextOptions options)
Parameters
device
Device1The device.
options
DeviceContextOptionsThe options to be applied to the created device context.
Remarks
The new device context will not have a selected target bitmap. The caller must create and select a bitmap as the target surface of the context.
DeviceContext1(nint)
public DeviceContext1(nint nativePtr)
Parameters
nativePtr
nint
Methods
DrawGeometryRealization(GeometryRealization, Brush)
Renders a given geometry realization to the target with the specified brush.
public void DrawGeometryRealization(GeometryRealization geometryRealization, Brush brush)
Parameters
geometryRealization
GeometryRealizationThe geometry realization to be rendered.
brush
BrushThe brush to render the realization with.
Remarks
This method respects all currently set state (transform, DPI, unit mode, target image, clips, layers); however, artifacts such as faceting may appear when rendering the realizations with a large effective scale (either via the transform or the DPI). Callers should create their realizations with an appropriate flattening tolerance using either D2D1_DEFAULT_FLATTENING_TOLERANCE or ComputeFlatteningTolerance to compensate for this.
Additionally, callers should be aware of the safe render bounds when creating geometry realizations. If a geometry extends outside of [-524,287, 524,287] DIPs in either the X- or the Y- direction in its original (pre-transform) coordinate space, then it may be clipped to those bounds when it is realized. This clipping will be visible even if the realization is subsequently transformed to fit within the safe render bounds.
Operators
explicit operator DeviceContext1(nint)
public static explicit operator DeviceContext1(nint nativePtr)
Parameters
nativePtr
nint