Render.TestImage C# (CSharp) Method

TestImage() public static method

public static TestImage ( Random rand, ICanvas canvas, float width, float height, int lines = 100 ) : void
rand Random
canvas ICanvas
width float
height float
lines int
return void
    public static void TestImage(Random rand, ICanvas canvas, float width, float height, int lines = 100)
    {
        canvas.FillColor = Colors.Navy;
        canvas.FillRectangle(0, 0, width, height);

        canvas.StrokeColor = Colors.White;
        for (int i = 0; i < lines; i++)
        {
            float x1 = (float)rand.NextDouble() * width;
            float x2 = (float)rand.NextDouble() * width;
            float y1 = (float)rand.NextDouble() * height;
            float y2 = (float)rand.NextDouble() * height;
            canvas.DrawLine(x1, y1, x2, y2);
        }
    }
}