当前位置: 代码迷 >> .NET新技术 >> 求各位大神帮忙,想破头了都没想出来,跪求解决方法
  详细解决方案

求各位大神帮忙,想破头了都没想出来,跪求解决方法

热度:295   发布时间:2016-04-25 01:26:33.0
求各位大神帮忙,想破头了都没想出来,跪求
这是一个点绕圆轨迹运动的程序,只是一个点,但是结果留下了哪一点的运动轨迹,程序代码如下:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace 点绕圆轨迹运动
{
    public partial class Form1 : Form
    {
        public Bitmap bit;
        public Bitmap bitmap;
        public Pen pen = new Pen(Color.Black,2);

        double a;
        double b;
        double angle;
        int degrees = 0;

        //public Graphics de;

        public Form1()
        {
            InitializeComponent();
            Graphics de = this.CreateGraphics();
            de.DrawEllipse(pen, 50, 50, 100, 100);
        }

        
        public int j=0;
        

        private void timer1_Tick(object sender, EventArgs e)
        {
            angle = Math.PI * degrees / 180.0;
            a = Math.Cos(angle) * 50;
            b = Math.Sin(angle) * 50;
            //this.Invalidate();
            degrees++;
        }

        public Bitmap drawbitmap;
        public void drawimage()
        {
            //drawbitmap = new Bitmap(50, 50);
            //Graphics draw = Graphics.FromImage(drawbitmap);
            //draw.DrawEllipse(new Pen(Color.Pink, 2), 0, 0, 50, 50);
        }
        public int aa = 1;
        private void timer2_Tick(object sender, EventArgs e)
        {
            drawbitmap = new Bitmap(8, 8);
            
            Graphics draw = Graphics.FromImage(drawbitmap);

            draw.DrawEllipse(new Pen(Color.Red, 2), 0, 0, 6, 6);
            Graphics ab = this.pictureBox1.CreateGraphics();
            ab.DrawRectangle(new Pen(Color.Red, 3), 20 * aa, 200, 10, 10);
            ab.DrawImage(drawbitmap, 20 * aa, 100);
            draw.FillEllipse(Brushes.Black, 0, 0, 8, 8);
           
            ab.DrawEllipse(pen, 2, 2, 4, 4);
            ab.DrawImage(drawbitmap, 100 - 4 + (float)a, 100 - 4 + (float)b);
            
            
            //ab.Clear(Color.Transparent);

            aa++;
           
        }

      
       
        int i = 0;
        private void button_start_Click_1(object sender, EventArgs e)
        {
  相关解决方案