چرا از توابع خود C# برا اینکار استفاده نمیکنین ؟
private void Form2_Paint(object sender, PaintEventArgs e)
{
Rectangle beysi = new Rectangle(100, 100, 300, 100);
e.Graphics.TranslateTransform(beysi.Width - beysi.X / 2, beysi.Height - beysi.Y / 2);
e.Graphics.RotateTransform(45.0f);
e.Graphics.FillEllipse(Brushes.Blue, beysi);
}
اینم کد خودت ...
GraphicsPath path = new GraphicsPath();//<---------------------
int steps = 172;
double beta = -angle * (Math.PI / 180);
double sinbeta = Math.Sin(beta);
double cosbeta = Math.Cos(beta);
for (int i = 0; i < 360; i += 360 / steps)
{
double alpha = i * (Math.PI / 180);
double sinalpha = Math.Sin(alpha);
double cosalpha = Math.Cos(alpha);
double X = centerx + (width * cosalpha * cosbeta - height * sinalpha * sinbeta);
double Y = centery + (width * cosalpha * sinbeta + height * sinalpha * cosbeta);
m.SetPixel((int)X, (int)Y, Color.Red);
path.AddLines(new Point[] { new Point((int)X, (int)Y) });//<---------------------
}
Graphics.FromImage(m).FillPath(Brushes.Blue, path);//<---------------------