Spread Windows Forms 7.0 Product Documentation
Gradient Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.DrawingSpace Namespace > PSObject Class : Gradient Property


Glossary Item Box

Gets or sets the gradient for the object.

Syntax

Visual Basic (Declaration) 
Public Overridable Property Gradient As PSGradient
Visual Basic (Usage)Copy Code
Dim instance As PSObject
Dim value As PSGradient
 
instance.Gradient = value
 
value = instance.Gradient
C# 
public virtual PSGradient Gradient {get; set;}

Property Value

PSGradient object containing the gradient for the object

Remarks

This property is available at run time only.

Example

This example shows the use of the property in customizing a shape to illustrate the use of the property for classes that inherit this property.
C#Copy Code
System.Drawing.Point[] pts = {new System.Drawing.Point(25, 0), 
                            New System.Drawing.Point(0, 50), 
                            New System.Drawing.Point(20, 50), 
                            New System.Drawing.Point((int)2.5, 100), 
                            New System.Drawing.Point(40, 40), 
                            New System.Drawing.Point(20, 40), 
                            New System.Drawing.Point(40, 0), 
                            New System.Drawing.Point(25, 0)};

System.Drawing.Drawing2D.GraphicsPath gpath = new System.Drawing.Drawing2D.GraphicsPath();
gpath.AddPolygon(pts);

FarPoint.Win.Spread.DrawingSpace.PSGradient psg = new FarPoint.Win.Spread.DrawingSpace.PSGradient();
psg.Name = "custom";
psg.Style = FarPoint.Win.Spread.DrawingSpace.GradientStyle.RadialIntoCenter;
psg.Sections[0].Color = Color.Navy;
psg.Sections[0].AlphaBlend = 128;
psg.Sections[1].Color = Color.Magenta;
psg.Sections[1].AlphaBlend = 255;

FarPoint.Win.Spread.DrawingSpace.PSObject pso = new FarPoint.Win.Spread.DrawingSpace.CustomShape();
pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical;
pso.Shape = gpath;
pso.SetBounds(250, 250, 120, 120);
pso.Gradient = psg;
fpSpread1.ActiveSheet.AddShape(pso);
Visual BasicCopy Code
Dim pts As System.Drawing.Point() = {New System.Drawing.Point(25, 0),  _
                            New System.Drawing.Point(0, 50),  _
                            New System.Drawing.Point(20, 50),  _
                            New System.Drawing.Point(2.5, 100),  _
                            New System.Drawing.Point(40, 40),  _
                            New System.Drawing.Point(20, 40),  _
                            New System.Drawing.Point(40, 0),  _
                            New System.Drawing.Point(25, 0)}

Dim gpath As System.Drawing.Drawing2D.GraphicsPath = New System.Drawing.Drawing2D.GraphicsPath
gpath.AddPolygon(pts)

Dim psg As New FarPoint.Win.Spread.DrawingSpace.PSGradient
psg.Style = FarPoint.Win.Spread.DrawingSpace.GradientStyle.RadialIntoCenter
psg.Sections(0).Color = Color.Navy
psg.Sections(0).AlphaBlend = 128
psg.Sections(1).Color = Color.Magenta
psg.Sections(1).AlphaBlend = 255

Dim pso As New FarPoint.Win.Spread.DrawingSpace.CustomShape

pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical
pso.Shape = gpath
pso.SetBounds(250, 250, 120, 120)
pso.Gradient = psg
FpSpread1.ActiveSheet.AddShape(pso)

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.