Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using var img = new Image<Rgba32>(200, 200);
- var brush = new SixLabors.ImageSharp.Processing.PathGradientBrush(
- new[]
- {
- new SixLabors.Shapes.LinearLineSegment(new PointF(0, 0), new PointF(200, 0)),
- new SixLabors.Shapes.LinearLineSegment(new PointF(200, 0), new PointF(200, 200)),
- new SixLabors.Shapes.LinearLineSegment(new PointF(200, 200), new PointF(0, 200)),
- new SixLabors.Shapes.LinearLineSegment(new PointF(0, 200), new PointF(0, 0))
- },
- new[]
- {
- Color.Red,
- Color.Yellow,
- Color.Green,
- Color.DarkCyan
- }
- );
- img.Mutate(m => m.Fill(brush));
- img.Save("out.png");
Advertisement
Add Comment
Please, Sign In to add comment