示例#1
0
 private void picSwitch_Click(object sender, EventArgs e)
 {
     _BeginPeriod((uint)_speed);
     if (switch_flag == 0)
     {
         for (int i = 0; i < 90; i++)
         {
             picSwitch.Image    = display[i];
             picSwitch.Location = Point.Round(set[i]);
             picSwitch.Update();
             switchPanel.Invalidate();
             Thread.Sleep(_speed);
         }
         picSwitch.Location = new Point(0, 0);
         picSwitch.Image    = secondBmp;
         switch_flag        = 1;
     }
     else
     if (switch_flag == 1)
     {
         for (int i = 89; i >= 0; i--)
         {
             picSwitch.Image    = display[i];
             picSwitch.Location = Point.Round(set[i]);
             picSwitch.Update();
             switchPanel.Invalidate();
             Thread.Sleep(_speed);
         }
         picSwitch.Location = new Point(0, 0);
         picSwitch.Image    = firstBmp;
         switch_flag        = 0;
     }
     _EndPeriod((uint)_speed);
 }
示例#2
0
    private void _ImgMouseLeave(object sender, EventArgs e)
    {
        UiControlsMethod.PictureBoxEx Lg = (UiControlsMethod.PictureBoxEx)sender;
        Lg.BackColor = _leaveColor;
        Bitmap   bmp_item = new Bitmap(Lg.Width, Lg.Height);
        Graphics gItem    = Graphics.FromImage(bmp_item);

        gItem.DrawImage(_dropItemList[(int)Lg.Parent.Tag]._bmpItem, _bmpItemXY);
        UiDrawTextMethod _ds = new UiDrawTextMethod();

        _ds.DrawString(bmp_item, _dropItemList[(int)Lg.Parent.Tag]._string, _fnt, _fntcolor, new Rectangle(_stringItemXY, bmp_item.Size));
        Lg.Image = bmp_item;
        Lg.Update();
    }
示例#3
0
 private void _Click(object sender, EventArgs e)
 {
     UiControlsMethod.PictureBoxEx pL = (UiControlsMethod.PictureBoxEx)sender;
     if (State)
     {
         State    = false;
         pL.Image = _bmpCheck;
     }
     else
     {
         State    = true;
         pL.Image = _bmpChecked;
     }
     pL.Update();
 }
示例#4
0
    public void _setProgress(int _skip)
    {
        if (_skip == _maxNum)
        {
            _skip = _operationWidth;
        }
        else
        {
            var t = (decimal)_operationWidth / _maxNum;
            _skip = (int)(_skip * t);
        }


        Bitmap   _progressImage = bmp_progress.Clone(new Rectangle(0, 0, bmp_progress.Width, bmp_progress.Height), System.Drawing.Imaging.PixelFormat.DontCare);
        Graphics _gblock        = Graphics.FromImage(_progressImage);

        _gblock.DrawImage(gress_Left, m_set[6], m_set[8], gress_Left.Width, gress_Left.Height);
        for (int i = 0; i < _skip; i++)
        {
            _gblock.DrawImage(gress_Mid, m_set[6] + m_set[3] + i, m_set[8], 1, gress_Mid.Height);
        }
        _gblock.DrawImage(gress_Right, m_set[6] + m_set[3] + _skip, m_set[8], m_set[5], gress_Right.Height);

        _progress.Image = _progressImage;
        _progress.Update();

        if (showFlag)
        {
            Bitmap   bmp_flag = new Bitmap(_progressFlag.Width, _progressFlag.Height);
            Graphics gFlag    = Graphics.FromImage(bmp_flag);
            gFlag.DrawImage(_bmpFlag, _skip + (_bmpFlag.Width / 2) + m_set[3] + m_set[5], 0, _bmpFlag.Width, _bmpFlag.Height);
            progressValue = (_skip / (float)_operationWidth * 100).ToString("#0");
            int str_x = m_flag[1];
            str_x = str_x - (progressValue.Length - 1) * 3;
            ud.DrawString(
                bmp_flag,
                progressValue + "%",
                fnt,
                txt_Color,
                new Rectangle(_skip + (_bmpFlag.Width / 2) + m_set[3] + m_set[5] + m_flag[1] + str_x, m_flag[2], 30, 20)
                );
            _progressFlag.Image = bmp_flag;
            _progressFlag.Update();
        }
    }