111,128
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.IO;
namespace _64格子
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.DoubleBuffered = true;//开启双缓冲,减少闪烁
}
public int k;
public int j;
int r;
public int l;
Bitmap bmp;
Graphics g;
private void Form1_Load(object sender, EventArgs e)
{
k = -750;
j = -375;
r = 1500;
//timer1.Start();
l = 0;
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
bmp = new Bitmap(this.Width,this.Height);
Pen pen = new Pen(Color.Red, 1);
g = Graphics.FromImage(bmp);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.DrawPie(pen, k, j, r, r, -15, 30);
g.DrawPie(pen, k, j, r, r, 0, 30);
for (double n = 500; n <= r; n += 62.5)
{
g.DrawPie(pen, -(int)n/2+l, (int)(j + (r - n) / 2), (int)n, (int)n, -30, 60);
}
e.Graphics.DrawImage(bmp, new Point(0, 0));
}
private void timer1_Tick(object sender, EventArgs e)
{
if (k <= 1500)
{
k += 50;
l += 50;
Refresh();
g.Dispose();
bmp.Dispose();
}
else
{ return; }
}
}
}
