示例#1
0
        public ShityCat()
        {
            InitializeComponent();
            cat      = new Animation(20, 100, 300, "..\\..\\images\\happy_0.jpg", "..\\..\\images\\happy_1.jpg");
            bellyful = new PictureBox()
            {
                Location = new Point(10, 5),
                Size     = new Size(130, 50),
                Image    = Image.FromFile("..\\..\\images\\bellyful.jpg"),
                SizeMode = PictureBoxSizeMode.StretchImage,
            };
            this.Controls.Add(bellyful);
            happiness = new PictureBox()
            {
                Location = new Point(10, 60),
                Size     = new Size(120, 40),
                Image    = Image.FromFile("..\\..\\images\\happiness.jpg"),
                SizeMode = PictureBoxSizeMode.StretchImage,
            };
            this.Controls.Add(happiness);

            heart   = new LiveElements(3, 140, 5, 40, 2000, this, Image.FromFile("..\\..\\images\\heart.jpg"));
            catFace = new LiveElements(3, 140, 60, 40, 3000, this, Image.FromFile("..\\..\\images\\catFace.jpg"));

            timer.Interval = 100;
            timer.Tick    += Timer_Tick;
            timer.Start();
        }
示例#2
0
 private void RestoreElement(int i, LiveElements le)
 {
     le.Restore(i);
     le.RestartTimer();
 }