System.Drawing.Drawing2D.LinearGradientBrush.Clone C# (CSharp) Method

Clone() public method

public Clone ( ) : object
return object
        public override object Clone()
        {
            var clone = new LinearGradientBrush(this.rectangle, colors[0], colors[1],
                                                angle, angleIsScalable);
            clone.Blend = blend;
            if (interpolationColorsWasSet)
                clone.InterpolationColors = colorBlend;
            clone.Transform = gradientTransform;
            clone.GammaCorrection = gammaCorrection;

            return clone;
        }

Usage Example

Exemplo n.º 1
0
		public void Clone ()
		{
			LinearGradientBrush lgb = new LinearGradientBrush (rect, c1, c2, 0f);
			LinearGradientBrush clone = (LinearGradientBrush) lgb.Clone ();
			Assert.AreEqual (lgb.Blend.Factors.Length, clone.Blend.Factors.Length, "Blend.Factors.Length");
			Assert.AreEqual (lgb.Blend.Positions.Length, clone.Blend.Positions.Length, "Blend.Positions.Length");
			Assert.AreEqual (lgb.GammaCorrection, clone.GammaCorrection, "GammaCorrection");
			Assert.AreEqual (lgb.LinearColors.Length, clone.LinearColors.Length, "LinearColors.Length");
			Assert.AreEqual (lgb.LinearColors.Length, clone.LinearColors.Length, "LinearColors.Length");
			Assert.AreEqual (lgb.Rectangle, clone.Rectangle, "Rectangle");
			Assert.AreEqual (lgb.Transform, clone.Transform, "Transform");
			Assert.AreEqual (lgb.WrapMode, clone.WrapMode, "WrapMode");
		}
All Usage Examples Of System.Drawing.Drawing2D.LinearGradientBrush::Clone