You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the most performant way to draw lots of short straight lines? Current code:
public void Stroke()
{
var pathCollection = new PathCollection(Paths);
Image.Mutate(ctx => ctx.Draw(Brush, StrokeThickness, pathCollection));
}
As I can see, most time is spent on FindIntersections and Allocate.
When using
var options = new ShapeGraphicsOptions
{
GraphicsOptions = new GraphicsOptions { Antialias = false, AlphaCompositionMode = PixelAlphaCompositionMode.Src },
};
It's a little bit better (not much), but the result is ugly (the line is drawn correctly in "stairs-style", but it seems there's an ugly border around the lines - maybe I used a wrong AlphaCompositionMode mode.).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What is the most performant way to draw lots of short straight lines? Current code:
As I can see, most time is spent on
FindIntersections
andAllocate
.When using
It's a little bit better (not much), but the result is ugly (the line is drawn correctly in "stairs-style", but it seems there's an ugly border around the lines - maybe I used a wrong AlphaCompositionMode mode.).
Beta Was this translation helpful? Give feedback.
All reactions