private void
buttonDonekDikdortgen_Click(object sender, EventArgs e)
{
timerDikdortgen.Start();
rnd = new Random();
}
int aci = 0;
Random rnd;
private void
timerDikdortgen_Tick(object sender, EventArgs e)
{
this.Refresh();
Graphics g = this.CreateGraphics();
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
// üstteki kod satırı çizimlerin daha yumuşak hatlı ve daha kaliteli olmasını sağlar.
Color renk = Color.FromArgb(rnd.Next(256),
rnd.Next(256), rnd.Next(256));
Pen kalem = new Pen(renk, 2.0f);
g.TranslateTransform(-250, -200, System.Drawing.Drawing2D.MatrixOrder.Prepend);
g.RotateTransform(aci, System.Drawing.Drawing2D.MatrixOrder.Append);
g.TranslateTransform(250, 200, System.Drawing.Drawing2D.MatrixOrder.Append);
g.DrawRectangle(kalem, 100, 100, 300,
200);
aci += 1;
}
Hiç yorum yok:
Yorum Gönder