コード例 #1
0
        public void DrawAnimation(Graphics graphics)
        {
            if (_animation && _rippleEffectsManager.IsAnimating())
            {
                for (var i = 0; i < _rippleEffectsManager.GetAnimationCount(); i++)
                {
                    double animationValue = _rippleEffectsManager.GetProgress(i);

                    Point      animationSource = new Point(_box.X + (_box.Width / 2), _box.Y + (_box.Height / 2));
                    SolidBrush animationBrush  = new SolidBrush(Color.FromArgb((int)(animationValue * 40), (bool)_rippleEffectsManager.GetData(i)[0] ? Color.Black : _checkStyle.CheckColor));

                    int height = _box.Height;
                    int size   = _rippleEffectsManager.GetDirection(i) == AnimationDirection.InOutIn ? (int)(height * (0.8d + (0.2d * animationValue))) : height;

                    Rectangle    _animationBox = new Rectangle(animationSource.X - (size / 2), animationSource.Y - (size / 2), size, size);
                    GraphicsPath _path         = VisualBorderRenderer.CreateBorderTypePath(_animationBox, _border);

                    graphics.FillPath(animationBrush, _path);
                    animationBrush.Dispose();
                }
            }
        }