C/C++の宿題片付けます 145代目
■ このスレッドは過去ログ倉庫に格納されています
0735Rie
2011/01/22(土) 01:18:13[2]最後にまとめて記載します
[3] 環境
[3.1] Windows
[3.2] VC2005
[3.3] C#
[4] 期限:2011年1月24日
[5] その他の制限:一切なし
private void Form1_Paint_1(object sender, PaintEventArgs e)
{ DrawCircle(e.Graphics, 100, 100, 100, 7); }
private void DrawCircle(Graphics g, double x,double y, int radius, int num)
{ Random rnd = new Random();
int value = 126 * num / 6;
SolidBrush opaqueBrush = new SolidBrush(Color.FromArgb(value, 0, 0, 153));
g.FillEllipse(opaqueBrush, (int)x, (int)y, radius * 2, radius * 2);
if (num > 1)
{ int branches = rnd.Next(2, 6);
for (int j = 0; j < branches; j++)
{ double a = rnd.NextDouble() * 2.0 * Math.PI;
double newx = x + Math.Cos(a) * 6.0 * (num - 1);
double newy = y + Math.Sin(a) * 6.0 * (num - 1);
DrawCircle(g, newx, newy, radius / 2, (num - 1));
}}}}}
■ このスレッドは過去ログ倉庫に格納されています