-
|
Hello! I want to create image, fill it, add borders (so I can choose pixel width), I think I have to use Rectangle to do that, but while testing, I noticed that it does round rectangle for some reason, making antialias=false not helps, so any solution? (was trying #107) using var image = new Image<Rgba32>(Configuration.Default, 200, 200, Color.Black);
var pen = Pens.Solid(Color.Red, 2);
var rect = new Rectangle(
100,
100,
50,
50
);
image.Mutate(ctx =>
{
ctx.SetGraphicsOptions(new GraphicsOptions {Antialias = false});
ctx.Draw(
pen,
rect
);
});
image.Save("image.png");
Excepted result is rectangle with no rounding |
Beta Was this translation helpful? Give feedback.
Answered by
Nazar1ky
Mar 10, 2026
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Nazar1ky
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

https://github.com/SixLabors/ImageSharp.Drawing/blob/js/canvas-api/tests/ImageSharp.Drawing.Tests/Processing/DrawingCanvasTests.Primitives.cs