Replies: 2 comments 2 replies
-
Not a fan of implicit operators and we should not add a reference to System.Drawing.Common. Also don't think we need the conversion from the System.Drawing types to the SixLabors primitives. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Let's keep these ideas separate.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a wild feature suggestion, so don't take it too seriosly!
Lately, I've been experimenting with implicit constructors with value tuples for common structures that really help trimming the amount of code to write.
The best way to show this is with an example:
We usually draw a polygon like this:
now, if PointF would implement the implicit constructor:
the previous example can be refactored into this:
This can be applied to several structures that require multiple construction arguments, PointF, RectangleF, maybe even colors.
Additionally, Given that System.Drawing.Common is part of NetStandard/NetCore and it is there even if you don't reference it, I've also began using some additional implicit constructors, expecting System.Drawing.Point and System.Drawing.Rectangle.
That way, you can seamlessly use System.Drawing.Point and Rectangle, in place of SixLabors primitives.
Beta Was this translation helpful? Give feedback.
All reactions