Drawing polygons/shapes using negative values #188
-
I am currently in the process of migrating from System.Drawing to ImageSharp and I'm having some unexpected side effects I'm not sure how to overcome. The problem I am faced with is when doing "Drawing", if the circle previously went outside the bounds of the Bitmap, this was previously fine and it would draw the parts of the circle it could, simply clipping the drawn circle. With ImageSharp, this throws an out of bounds exception. This issue can be replicated using this code: using var image = new Image<Rgba32>(64, 64);
var ellipse = new EllipsePolygon(32, 32, 70, 70);
var points = ellipse.Points.ToArray();
image.Mutate(x => x.Draw(SixLabors.ImageSharp.Color.Green, 1f, ellipse));
using var memoryStream = new MemoryStream();
image.Save(memoryStream, new JpegEncoder());
Util.Image(memoryStream.ToArray()).Dump(); Which gives:
Is there a way that this would be possible at all? Such as configuration that would allow me to draw all the shape that I can? This is the desired effect that I could achieve using System.Drawing: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
This looks like it could be related to #170 could you please try the MyGet build 1.0.0-beta13.17 to see if we’ve already fixed it? |
Beta Was this translation helpful? Give feedback.
This looks like it could be related to #170 could you please try the MyGet build 1.0.0-beta13.17 to see if we’ve already fixed it?