Porting from Visual C# 2D Drawing to Six Labors #179
Unanswered
jkowalski0058
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a few lines of code I need to rewrite using Six Labors and am struggling
Legacy C# Code works with VS2019:
var path = new System.Drawing.Drawing2D.GraphicsPath();
path.AddLines( pointArray.ToArray() );
RectangleF rect = path.GetBounds();
float longSize = Math.Max(rect.Width, rect.Height);
How do I use Six Labors to return the same rectangle result of {X = 11 Y = 1 Width = 13 Height = 9} given the following input array of points?
path.PathPoints {System.Drawing.PointF[59]}[]
[0] {X = 22 Y = 1}
[1] {X = 24 Y = 1}
[2] {X = 23 Y = 1}
[3] {X = 23 Y = 2}
[4] {X = 22 Y = 2}
[5] {X = 21 Y = 2}
[6] {X = 21 Y = 3}
[7] {X = 20 Y = 3}
[8] {X = 20 Y = 4}
[9] {X = 21 Y = 4}
[10] {X = 22 Y = 4}
[11] {X = 22 Y = 3}
[12] {X = 23 Y = 3}
[13] {X = 23 Y = 4}
[14] {X = 22 Y = 5}
[15] {X = 21 Y = 5}
[16] {X = 20 Y = 5}
[17] {X = 19 Y = 5}
[18] {X = 19 Y = 6}
[19] {X = 18 Y = 6}
[20] {X = 17 Y = 6}
[21] {X = 16 Y = 6}
[22] {X = 16 Y = 7}
[23] {X = 15 Y = 7}
[24] {X = 14 Y = 7}
[25] {X = 13 Y = 7}
[26] {X = 12 Y = 7}
[27] {X = 11 Y = 7}
[28] {X = 11 Y = 8}
[29] {X = 12 Y = 8}
[30] {X = 13 Y = 8}
[31] {X = 14 Y = 8}
[32] {X = 15 Y = 8}
[33] {X = 16 Y = 8}
[34] {X = 17 Y = 8}
[35] {X = 17 Y = 7}
[36] {X = 18 Y = 7}
[37] {X = 19 Y = 7}
[38] {X = 20 Y = 7}
[39] {X = 20 Y = 6}
[40] {X = 21 Y = 6}
[41] {X = 22 Y = 6}
[42] {X = 22 Y = 7}
[43] {X = 21 Y = 7}
[44] {X = 21 Y = 8}
[45] {X = 20 Y = 8}
[46] {X = 19 Y = 8}
[47] {X = 18 Y = 8}
[48] {X = 18 Y = 9}
[49] {X = 17 Y = 9}
[50] {X = 16 Y = 9}
[51] {X = 15 Y = 9}
[52] {X = 17 Y = 10}
[53] {X = 18 Y = 10}
[54] {X = 19 Y = 10}
[55] {X = 19 Y = 9}
[56] {X = 20 Y = 9}
[57] {X = 21 Y = 9}
[58] {X = 20 Y = 10}
Thanks in advance for any info
Beta Was this translation helpful? Give feedback.
All reactions