コード例 #1
0
        private void pictureBox1_Paint(object sender, PaintEventArgs e)//可以删掉第一个刷新方法合并两种方法
        {
            try
            {
                //清屏
                e.Graphics.Clear(Color.White);

                //重绘
                switch (MyGlo.update_function)
                {
                case 0:    //全图显示刷新
                    Funcs.Update(e.Graphics, this.pictureBox1.Width, this.pictureBox1.Height);
                    Funcs.MouseClear();
                    break;

                case 1:    //移动刷新
                    Funcs.Update(e.Graphics, this.pictureBox1.Width, this.pictureBox1.Height, 1);
                    break;
                }

                //默认全图显示刷新
                MyGlo.update_function = 0;
            }
            catch
            {
                MessageBox.Show("绘制图像时出错");
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: hehao1999/CSharp
        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
            //清屏
            e.Graphics.Clear(Color.White);

            //重绘
            switch (MyGlo.update_function)
            {
            case 0:    //全图显示刷新
                Funcs.Update(e.Graphics, this.pictureBox1.Width, this.pictureBox1.Height);
                Funcs.MouseClear();
                break;

            case 1:    //移动刷新
                Funcs.Update(e.Graphics, this.pictureBox1.Width, this.pictureBox1.Height, 1);
                break;
            }

            //默认全图显示刷新
            MyGlo.update_function = 0;
        }