MESCIUS SPREAD for Windows Forms 15.0J
Gradient プロパティ (PSObject)
使用例 

オブジェクトのグラデーションを取得または設定します。
構文
'宣言
 
Public Overridable Property Gradient As PSGradient
public virtual PSGradient Gradient {get; set;}

プロパティ値

オブジェクトのグラデーションを含むPSGradientオブジェクト
解説
このプロパティが使用できるのは実行時のみです。
使用例
次のサンプル コードでは、このプロパティを継承するクラスでのプロパティの使用方法を示すために、このプロパティを使用してシェイプをカスタマイズしています。
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((FarPoint.Win.Spread.DrawingSpace.PSShape)pso);
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)
参照

PSObject クラス
PSObject メンバ

 

 


© MESCIUS inc. All rights reserved.