/// <summary> /// Gets the value for step. /// </summary> /// <param name="step">The step.</param> /// <returns>System.Object.</returns> protected override object GetValueForStep(double step) { if (this._startColor == Color.Empty || this._endColor == Color.Empty) { return(this.CurrentValue); } return((object)ZeroitSpecAnimatorBase.InterpolateColors(this._startColor, this._endColor, step)); }
/// <summary> /// Removes the child animator. /// </summary> /// <param name="animator">The animator.</param> /// <exception cref="System.ArgumentNullException">animator</exception> protected void RemoveChildAnimator(ZeroitSpecAnimatorBase animator) { if (animator == null) { throw new ArgumentNullException(nameof(animator)); } if (!this._childAnimators.Contains((object)animator)) { return; } this._childAnimators.Remove((object)animator); }
/// <summary> /// Adds the child animator. /// </summary> /// <param name="animator">The animator.</param> /// <exception cref="System.ArgumentNullException">animator</exception> protected void AddChildAnimator(ZeroitSpecAnimatorBase animator) { if (animator == null) { throw new ArgumentNullException(nameof(animator)); } if (!this._childAnimators.Contains((object)animator)) { this._childAnimators.Add((object)animator); } animator.SetIntervall(this.Intervall, false); animator.SetStepSize(this.StepSize, false); animator.SetLoopMode(this.ZeroitSpecLoopMode, false); animator.SetSynchronizationMode(this.ZeroitSpecSynchronizationMode, false); }
/// <summary> /// Gets the value for step. /// </summary> /// <param name="step">The step.</param> /// <returns>System.Object.</returns> protected override object GetValueForStep(double step) { return((object)ZeroitSpecAnimatorBase.InterpolateRectangles(this._startBounds, this._endBounds, step)); }
/// <summary> /// Interpolates the sizes. /// </summary> /// <param name="size1">The size1.</param> /// <param name="size2">The size2.</param> /// <param name="percent">The percent.</param> /// <returns>Size.</returns> public static Size InterpolateSizes(Size size1, Size size2, double percent) { return(new Size(ZeroitSpecAnimatorBase.InterpolateIntegerValues(size1.Width, size2.Width, percent), ZeroitSpecAnimatorBase.InterpolateIntegerValues(size1.Height, size2.Height, percent))); }
/// <summary> /// Interpolates the points. /// </summary> /// <param name="point1">The point1.</param> /// <param name="point2">The point2.</param> /// <param name="percent">The percent.</param> /// <returns>Point.</returns> public static Point InterpolatePoints(Point point1, Point point2, double percent) { return(new Point(ZeroitSpecAnimatorBase.InterpolateIntegerValues(point1.X, point2.X, percent), ZeroitSpecAnimatorBase.InterpolateIntegerValues(point1.Y, point2.Y, percent))); }
/// <summary> /// Interpolates the rectangles. /// </summary> /// <param name="rectangle1">The rectangle1.</param> /// <param name="rectangle2">The rectangle2.</param> /// <param name="percent">The percent.</param> /// <returns>Rectangle.</returns> public static Rectangle InterpolateRectangles(Rectangle rectangle1, Rectangle rectangle2, double percent) { return(new Rectangle(ZeroitSpecAnimatorBase.InterpolatePoints(rectangle1.Location, rectangle2.Location, percent), ZeroitSpecAnimatorBase.InterpolateSizes(rectangle1.Size, rectangle2.Size, percent))); }
/// <summary> /// Interpolates the colors. /// </summary> /// <param name="color1">The color1.</param> /// <param name="color2">The color2.</param> /// <param name="percent">The percent.</param> /// <returns>Color.</returns> public static Color InterpolateColors(Color color1, Color color2, double percent) { return(Color.FromArgb(ZeroitSpecAnimatorBase.InterpolateIntegerValues((int)color1.A, (int)color2.A, percent), ZeroitSpecAnimatorBase.InterpolateIntegerValues((int)color1.R, (int)color2.R, percent), ZeroitSpecAnimatorBase.InterpolateIntegerValues((int)color1.G, (int)color2.G, percent), ZeroitSpecAnimatorBase.InterpolateIntegerValues((int)color1.B, (int)color2.B, percent))); }
/// <summary> /// Gets the value for step. /// </summary> /// <param name="step">The step.</param> /// <returns>System.Object.</returns> protected override object GetValueForStep(double step) { return((object)ZeroitSpecAnimatorBase.InterpolateDoubleValues(this._startOpacity, this._endOpacity, step)); }
/// <summary> /// Gets the value for step. /// </summary> /// <param name="step">The step.</param> /// <returns>System.Object.</returns> protected override object GetValueForStep(double step) { return((object)this.CheckValue(ZeroitSpecAnimatorBase.InterpolateIntegerValues(this._startValue, this._endValue, step))); }