Created
July 2, 2017 09:36
-
-
Save audinue/eb51c9c9f88103c53aeb29a6c6d7d403 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void OnPaint(PaintEventArgs e) | |
{ | |
base.OnPaint(e); | |
a += 1f; | |
var g = e.Graphics; | |
var gp = new GraphicsPath(); | |
gp.AddRectangle(new RectangleF(0, 0, 100, 100)); | |
var m = new Matrix(); | |
m.Translate(100, 100); | |
m.Translate(50, 50); | |
m.Rotate(a); | |
m.Scale(.5f, .5f); | |
gp.Transform(m); | |
g.FillRectangle(Brushes.Red, gp.GetBounds()); | |
g.DrawPath(Pens.Black, gp); | |
g.DrawRectangle(Pens.Blue, 100, 100, 100, 100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment