Table of Contents

Enum PointMode

Namespace
Egami.Drawing
Assembly
Egami.Drawing.dll
public enum PointMode

Fields

Lines = 1

Each pair of points is a line; an odd last point is ignored.

Points = 0

Each point is drawn as a dot: a square, or a circle with Round, of the stroke's width.

Polygon = 2

The points are joined, in order, into one open polyline.

Examples

// Axes, ticks and a data line for a chart: hairlines stay one pixel wide whatever the scale.
double[] values = [3, 7, 4, 9, 6, 11, 8];
using Raster<Rgba8> chart = Raster.Create(420, 260, Rgba8.White);
using (RasterCanvas<Rgba8> canvas = chart.CreateCanvas())
{
    Rgba8 axis = new(60, 60, 60, 255);
    canvas.DrawLine(new Vector2(40.5f, 20), new Vector2(40.5f, 230.5f), Stroke.Hairline, axis);
    canvas.DrawLine(new Vector2(40, 230.5f), new Vector2(400, 230.5f), Stroke.Hairline, axis);
    for (int i = 0; i < values.Length; i++)
    {
        float x = 40.5f + (i * 55);
        canvas.DrawLine(new Vector2(x, 230), new Vector2(x, 236), Stroke.Hairline, axis);
    }

    Vector2[] points = [.. values.Select((v, i) => new Vector2(40 + (i * 55), 230 - (float)(v * 18)))];
    canvas.DrawPoints(PointMode.Polygon, points, new Stroke(3) { Join = LineJoin.Round, Cap = LineCap.Round }, new Rgba8(30, 90, 200, 255));
    canvas.DrawPoints(PointMode.Points, points, new Stroke(8) { Cap = LineCap.Round }, new Rgba8(30, 90, 200, 255));
}