12 private PointF[] _points = [
new(0, 0),
new(1, 1)];
35 protected override void DrawGeometry(SKCanvas canvas, SKRect bounds, SKPaint paint)
37 PointF[] points = _points;
42 canvas.DrawLine(
MapPoint(points[0], bounds),
MapPoint(points[1], bounds), paint);
DirectLine(Color color, RenderSurfaceHostBase host, View view, Rectangle screenBounds, string? nickname=null)
Creates a view-space line within the supplied bounds.
override void DrawGeometry(SKCanvas canvas, SKRect bounds, SKPaint paint)
DirectLine SetEndpoints(PointF start, PointF end)
Sets endpoints in normalized local coordinates (0 to 1 on each axis).
DirectLine(Color color, RenderSurfaceHostBase host, SceneLayer sceneLayer, Rectangle worldBounds, string? nickname=null)
Creates a scene-layer line within the supplied bounds.
static SKPoint MapPoint(PointF point, SKRect bounds)
Maps a normalized local point into the drawing bounds.
static PointF[] CopyPoints(IEnumerable< PointF > points, int minimumCount)
Copies and validates a sequence of normalized local points.
DirectShapeBase(Color color, RenderSurfaceHostBase host, DirectDrawingMode mode, SceneLayer? sceneLayer, View? view, Rectangle bounds, string? nickname)
Represents a base class for hosting a render surface, providing functionality for managing rendering ...
DirectDrawingMode
Specifies where direct drawing operations are applied within the rendering pipeline.
@ View
Performs direct drawing at the view level using screen-space coordinates.
@ SceneLayer
Performs direct drawing within a scene layer using world-space coordinates.