So I'm having a bit of trouble getting these coordinates nailed down.
When I do e.Graphics.RotateTransform(45)
the result is this:
What I'd like to happen, and what happens in any photo editing software is this:
Here's the code. I know the sqrt(2)
ratio isn't perfect for rotating this, but I'll fix it after I've gotten this down.
Here's the code I use, that produces the faulty output:
Using G As Graphics = Graphics.FromImage(Canvas)
With G
.TextRenderingHint = Text.TextRenderingHint.AntiAlias
.CompositingQuality = CompositingQuality.HighQuality
.SmoothingMode = SmoothingMode.AntiAlias
' ROTATE AT 45 DEGREES
'.RotateTransform(45)
.DrawRectangle(New Pen(Color.Black, LineWidth), New Rectangle(New Point((Dims - NewSize) / 2, (Dims - NewSize) / 2), New Size(NewSize, NewSize)))
' NON-TRANSFORMED STUFF
' G.DrawString("ayy lmoa", New Font(New FontFamily("Arial"), 16, FontStyle.Bold), Brushes.Black, New Point(0, 0))
End With
End Using
Has anyone dealt with something like this before?