public void Draw(SKCanvas g, Color pen) { g.DrawRasterLine(pen, Left, Top); g.DrawRasterLine(pen, Right, Top); g.DrawRasterLine(pen, Right, Bottom); g.DrawRasterLine(pen, Left, Bottom); }
public void Draw(SKCanvas g, Color pen) { g.DrawRasterLine(pen, Left.X, Left.Y - 1, Top.X - 1, Top.Y); g.DrawRasterLine(pen, Right.X, Right.Y - 1, Top.X, Top.Y); g.DrawRasterLine(pen, Left.X, Left.Y, Bottom.X - 1, Bottom.Y); g.DrawRasterLine(pen, Right.X, Right.Y, Bottom.X, Bottom.Y); }
protected override void DrawIndexedDirection(SKCanvas g, TextureTile tile, NeighbourIndex idx) { var points = CreateShape(GetTileArea(tile)).ToHighlight().GetHighlightFor(idx); var brush = Grid.TextureTileFormattingMetaData.TileHighlightColor ?? Preferences.DefaultTileHighlightColor; for (var pidx = 1; pidx < points.Count; pidx += 1) { var p1 = points[pidx - 1]; var p2 = points[pidx]; g.DrawRasterLine(brush, p1.X, p1.Y, p2.X, p2.Y); } }
public static void DrawRasterLine(this SKCanvas g, Color color, float x1, float y1, float x2, float y2) { using var paint = new SKPaint() { Color = new SKColor(color.ToUint32()), IsAntialias = false, Style = SKPaintStyle.Fill, StrokeWidth = 0, StrokeCap = SKStrokeCap.Round }; g.DrawRasterLine(paint, x1, y1, x2, y2); }
void DrawHeightIndicator(SKCanvas g, TextureTile tile) { var rect = GetTileArea(tile); var extraSpace = rect.Y; // Only draw the extra height if the resulting box would be // sufficiently large. Otherwise the upper and lower shape // just meld together into a ugly blob. if (extraSpace < 5) { return; } var baseShape = CreateShape(rect); var brush = Grid.TextureTileFormattingMetaData.TileOutlineColor ?? Preferences.DefaultTileColor; var shape = CreateShape(new IntRect(rect.X, rect.Y - extraSpace, rect.Width, rect.Height)); shape.Draw(g, brush); g.DrawRasterLine(brush, baseShape.Left, shape.Left); g.DrawRasterLine(brush, baseShape.Right, shape.Right); g.DrawRasterLine(brush, baseShape.Bottom, shape.Bottom); }
public static void DrawGeometry(this SKCanvas g, Color color, List <IntPoint> p) { using var paint = new SKPaint() { Color = new SKColor(color.ToUint32()), IsAntialias = false, Style = SKPaintStyle.Stroke, StrokeWidth = 1 }; for (var i = 1; i < p.Count; i++) { var prev = p[i - 1]; var curr = p[i]; Logger.Verbose("Draw Polygon {P1} -> {P2}", prev, curr); g.DrawRasterLine(color, prev, curr); } }