コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Corp       = DrawCorp(Graphics.FromHwnd(pictureBox1.Handle));
            Roof       = DrawRoof(Graphics.FromHwnd(pictureBox1.Handle));
            BackWheel  = DrawWheel(Graphics.FromHwnd(pictureBox1.Handle));
            FrontWheel = DrawWheel(Graphics.FromHwnd(pictureBox1.Handle), 240);
            Lamp       = DrawLamp(Graphics.FromHwnd(pictureBox1.Handle));
            RoofDecor  = DrawRoofDecor(Graphics.FromHwnd(pictureBox1.Handle));

            for (var i = 0; i < 400; i++)
            {
                Thread.Sleep(12);
                Corp.Clear(BackColor);
                Roof.Clear(BackColor);
                BackWheel.Clear(BackColor);
                FrontWheel.Clear(BackColor);

                Corp       = DrawCorp(Corp, 0 + i);
                Roof       = DrawRoof(Roof, 75 + i);
                BackWheel  = DrawWheel(BackWheel, 50 + i, 190, i / 3);
                FrontWheel = DrawWheel(FrontWheel, 240 + i, 190, i / 3);
                Lamp       = DrawLamp(Lamp, 340 + i);
                RoofDecor  = DrawRoofDecor(RoofDecor, i);
            }
        }