Spread Windows Forms 12.0 Product Documentation
PSObject Constructor(Object)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.DrawingSpace Namespace > PSObject Class > PSObject Constructor : PSObject Constructor(Object)
Object from which to clone the new object
Creates a new presentation space object based on the specified object.
Syntax
'Declaration
 
Public Function New( _
   ByVal cloneFrom As Object _
)
'Usage
 
Dim cloneFrom As Object
 
Dim instance As New PSObject(cloneFrom)
public PSObject( 
   object cloneFrom
)

Parameters

cloneFrom
Object from which to clone the new object
Example
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.PSObject pso = new FarPoint.Win.Spread.DrawingSpace.CustomShape();
pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical;
pso.CanRotate = true;
pso.Shape = gpath;
pso.SetBounds(250, 250, 120, 120);
FarPoint.Win.Spread.DrawingSpace.CustomShape pso1 = new FarPoint.Win.Spread.DrawingSpace.CustomShape((FarPoint.Win.Spread.DrawingSpace.PSShape)pso);
fpSpread1.ActiveSheet.AddShape(pso1);
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 pso As New FarPoint.Win.Spread.DrawingSpace.CustomShape
pso.CanMove = FarPoint.Win.Spread.DrawingSpace.Moving.HorizontalAndVertical
pso.CanRotate = True
pso.Shape = gpath
pso.SetBounds(250, 250, 120, 120)
Dim pso1 As New FarPoint.Win.Spread.DrawingSpace.CustomShape(pso)

FpSpread1.ActiveSheet.AddShape(pso1)
See Also

Reference

PSObject Class
PSObject Members
Overload List