Class Pen
名称: Aspose.Imaging アセンション: Aspose.Imaging.dll (25.5.0)
線、曲線、数字を描くために使用されるオブジェクトを定義します。
public class Pen : TransparencySupporterInheritance
object ← TransparencySupporter ← Pen
相続人
TransparencySupporter.Equals(object) , TransparencySupporter.GetHashCode() , TransparencySupporter.Equals(TransparencySupporter) , TransparencySupporter.Opacity , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
この例では、ペンオブジェクトの作成と使用を示しています. この例では、新しい画像を作成し、画像の表面に直角を描きます。
//Create an instance of BmpOptions and set its various properties
Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
bmpOptions.BitsPerPixel = 24;
//Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
//Second Boolean parameter determines if the file to be created IsTemporal or not
bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);
//Create an instance of Image at specified Path
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
{
//Create an instance of Graphics and initialize it with Image object
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear the Graphics sutface with White Color
graphics.Clear(Aspose.Imaging.Color.White);
//Create an instance of Pen with color Red and width 5
Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);
//Create an instance of HatchBrush and set its properties
Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
brush.ForegroundColor = Aspose.Imaging.Color.Red;
//Create an instance of Pen
//initialize it with HatchBrush object and width
Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);
//Draw Rectangles by specifying Pen object
graphics.DrawRectangles(pen, new[]
{
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(210, 210), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 110), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 310), new Aspose.Imaging.Size(100, 100))
});
//Draw Rectangles by specifying Pen object
graphics.DrawRectangles(brusedpen, new[]
{
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 110), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 310), new Aspose.Imaging.Size(100, 100))
});
// save all changes.
image.Save();
}Constructors
Pen(Color)
Aspose.Imaging.Pen クラスの新しい例を指定した色で開始します。
public Pen(Color color)Parameters
color Color
Aspose.Imaging.Pen.Color の構造は、この Aspose.Imaging.Pen の色を示しています。
Pen(色、フラット)
Aspose.Imaging.Pen クラスの新しい例を、指定された Aspose.Imaging.Pen.Color と Aspose.Imaging.Pen.Width の特性で開始します。
public Pen(Color color, float width)Parameters
color Color
Aspose.Imaging.Pen.Color の構造は、この Aspose.Imaging.Pen の色を示しています。
width float
この Aspose.Imaging.Pen の幅を示す値です。
Examples
この例では、ペンオブジェクトの作成と使用を示しています. この例では、新しい画像を作成し、画像の表面に直角を描きます。
//Create an instance of BmpOptions and set its various properties
Aspose.Imaging.ImageOptions.BmpOptions bmpOptions = new Aspose.Imaging.ImageOptions.BmpOptions();
bmpOptions.BitsPerPixel = 24;
//Create an instance of FileCreateSource and assign it as Source for the instance of BmpOptions
//Second Boolean parameter determines if the file to be created IsTemporal or not
bmpOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(@"C:\temp\sample.bmp", false);
//Create an instance of Image at specified Path
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Create(bmpOptions, 500, 500))
{
//Create an instance of Graphics and initialize it with Image object
Aspose.Imaging.Graphics graphics = new Aspose.Imaging.Graphics(image);
//Clear the Graphics sutface with White Color
graphics.Clear(Aspose.Imaging.Color.White);
//Create an instance of Pen with color Red and width 5
Aspose.Imaging.Pen pen = new Aspose.Imaging.Pen(Aspose.Imaging.Color.Red, 5f);
//Create an instance of HatchBrush and set its properties
Aspose.Imaging.Brushes.HatchBrush brush = new Aspose.Imaging.Brushes.HatchBrush();
brush.BackgroundColor = Aspose.Imaging.Color.Wheat;
brush.ForegroundColor = Aspose.Imaging.Color.Red;
//Create an instance of Pen
//initialize it with HatchBrush object and width
Aspose.Imaging.Pen brusedpen = new Pen(brush, 5);
//Draw Rectangles by specifying Pen object
graphics.DrawRectangles(pen, new[]
{
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(210, 210), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 110), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 310), new Aspose.Imaging.Size(100, 100))
});
//Draw Rectangles by specifying Pen object
graphics.DrawRectangles(brusedpen, new[]
{
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(310, 110), new Aspose.Imaging.Size(100, 100)),
new Aspose.Imaging.Rectangle(new Aspose.Imaging.Point(110, 310), new Aspose.Imaging.Size(100, 100))
});
// save all changes.
image.Save();
}Pen(Brush)
Aspose.Imaging.Pen クラスの新しい例を指定した Aspose.Imaging.Pen.Brush クラスで開始します。
public Pen(Brush brush)Parameters
brush Brush
Aspose.Imaging.Pen.Brush は、この Aspose.Imaging.Pen の特性を決定します。
Exceptions
brush’ is null.
Pen(ブリュッシュ、フラット)
Aspose.Imaging.Pen クラスの新しい例を、指定された Aspose.Imaging.Pen.Brush と Aspose.Imaging.Pen.Width で開始します。
[JsonConstructor]
public Pen(Brush brush, float width)Parameters
brush Brush
Aspose.Imaging.Pen.Brush は、この Aspose.Imaging.Pen の特徴を決定します。
width float
新しい Aspose.Imaging.Pen の幅
Exceptions
brush’ is null.
Properties
Alignment
この Aspose.Imaging.Pen のための調整を取得または設定します。
public PenAlignment Alignment { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.Alignment 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
Brush
この Aspose.Imaging.Pen の属性を決定する Aspose.Imaging.Pen を取得または設定します。
public Brush Brush { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.Brush 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
Color
この Aspose.Imaging.Pen の色を取得または設定します。
public Color Color { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.Color 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
CompoundArray
コンポーネントペンを指定する値の範囲を取得または設定します コンポーネントペンは、並行線とスペースで構成されたコンポーネントラインを引き出します。
public float[] CompoundArray { get; set; }不動産価値
float ( )
Exceptions
Aspose.Imaging.Pen.CompoundArrayの特性は、Aspose.Imaging.Penクラスによって返還されたものと同様に、変わらないAspose.Imaging.Penに設定されています。
CustomEndCap
この Aspose.Imaging.Pen で引き出されたラインの終わりに使用するためにカスタマイズされたキャップを取得または設定します。
public CustomLineCap CustomEndCap { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.CustomEndCapの所有物は、Aspose.Imaging.Penクラスによって返還されたものと同様に、変わらないAspose.Imaging.Penに設定されています。
CustomStartCap
この Aspose.Imaging.Pen で引き出されたラインの始まりに使用するカスタマイズキャップを取得または設定します。
public CustomLineCap CustomStartCap { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.CustomStartCapの所有物は、Aspose.Imaging.Penクラスによって返還されたものと同様に、変わらないAspose.Imaging.Penに設定されています。
DashCap
この Aspose.Imaging.Pen で引き出されたダッシュラインを構成するダッシュの端に使用されるキャップスタイルを取得または設定します。
public DashCap DashCap { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.DashCap 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
DashOffset
ラインの始まりからダッシュパターンの始まりまでの距離を取得または設定します。
public float DashOffset { get; set; }不動産価値
DashPattern
受けるか設定する一連のカスタマイズダッシュとスペース。
public float[] DashPattern { get; set; }不動産価値
float ( )
Exceptions
Aspose.Imaging.Pen.DashPattern 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
DashStyle
この Aspose.Imaging.Pen で引き出されたダッシュラインに使用されるスタイルを取得または設定します。
public DashStyle DashStyle { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.DashStyle 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
EndCap
この Aspose.Imaging.Pen で引き出されたラインの終わりに使用されるキャップスタイルを取得または設定します。
public LineCap EndCap { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.EndCap 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
LineJoin
この Aspose.Imaging.Pen で引き出された 2 連続のラインの端に付属するスタイルを取得または設定します。
public LineJoin LineJoin { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.LineJoinの所有物は、Aspose.Imaging.Penクラスによって返還されたものと同様に、変わらないAspose.Imaging.Penに設定されています。
MiterLimit
接続の厚さの限界を測定された角に取得または設定します。
public float MiterLimit { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.MiterLimit 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
PenType
この Aspose.Imaging.Pen で引き出されたラインのスタイルを取得します。
[JsonIgnore]
public PenType PenType { get; }不動産価値
StartCap
この Aspose.Imaging.Pen で描かれたラインの始まりに使用されるキャップスタイルを取得または設定します。
public LineCap StartCap { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.StartCapの所有物は、Aspose.Imaging.Penクラスによって返還されたものと同様に、変わらないAspose.Imaging.Penに設定されています。
Transform
この Aspose.Imaging.Pen のための地質変換のコピーを取得または設定します。
public Matrix Transform { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.Transform 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
Width
この Aspose.Imaging.Pen の幅を、図面に使用されるグラフィックオブジェクトのユニットで取得または設定します。
public float Width { get; set; }不動産価値
Exceptions
Aspose.Imaging.Pen.Width 属性は、Aspose.Imaging.Pen クラスによって返還されたものと同様に、変わらない Aspose.Imaging.Pen に設定されています。
Methods
Equals(対象)
物体が平等であるかどうかを確認する。
public override bool Equals(object obj)Parameters
obj object
他のオブジェクト
Returns
平等比較の結果
Equals(Pen)
物体が平等であるかどうかを確認する。
protected bool Equals(Pen other)Parameters
other Pen
他のオブジェクト
Returns
平等比較の結果
GetHashCode()
現在のオブジェクトのハッシュコードを取得します。
public override int GetHashCode()Returns
ハッシュコード
MultiplyTransform(Matrix)
この Aspose.Imaging.Pen の変換マトリックスを指定した Aspose.Imaging.Matrix によって倍増します。
public void MultiplyTransform(Matrix matrix)Parameters
matrix Matrix
Aspose.Imaging.Matrix は、変換マトリックスを複数化するための物体です。
MultiplyTransform(マトリックス、マトリックスオーダー)
この Aspose.Imaging.Pen の変換マトリックスを指定した Aspose.Imaging.Matrix によって指定された順序で倍増します。
public void MultiplyTransform(Matrix matrix, MatrixOrder order)Parameters
matrix Matrix
Aspose.Imaging.Matrix は、変換マトリックスを複数化するためのマトリックスです。
order MatrixOrder
複数の操作を実行するための順序。
ResetTransform()
この Aspose.Imaging.Pen のための地質変換マトリックスをアイデンティティにリセットします。
public void ResetTransform()RotateTransform(フラット)
地元の地質学的変換を指定された角度で回転します この方法は、変換に回転を前提とします。
public void RotateTransform(float angle)Parameters
angle float
回転の角度。
RotateTransform(フロア、マトリックスオーダー)
地元の地質変換を指定された順序で指定された角度で回転します。
public void RotateTransform(float angle, MatrixOrder order)Parameters
angle float
回転の角度。
order MatrixOrder
Aspose.Imaging.MatrixOrder は、回転マトリックスを追加するかプレビングするかどうかを指定します。
ScaleTransform(フロア、フロア)
地元の地質学的変換を指定した要因によってスケールするこの方法は、スケールマトリックスを変換に先立つ。
public void ScaleTransform(float sx, float sy)Parameters
sx float
変換をX軸の方向にスケールする要因です。
sy float
Y軸の方向における変換をスケールする要因です。
ScaleTransform(フラット、フラット、マトリックスオーダー)
地元の地質変換を指定された順序の要因によってスケールします。
public void ScaleTransform(float sx, float sy, MatrixOrder order)Parameters
sx float
変換をX軸の方向にスケールする要因です。
sy float
Y軸の方向における変換をスケールする要因です。
order MatrixOrder
Aspose.Imaging.MatrixOrder は、スケールマトリックスを拡張するか拡張するかを指定します。
SetLineCap(・LineCap、LineCap、DashCap)
この Aspose.Imaging.Pen によって引き出された端線に使用されるキャップのスタイルを決定する値を設定します。
public void SetLineCap(LineCap startCap, LineCap endCap, DashCap dashCap)Parameters
startCap LineCap
A Aspose.Imaging.LineCap that represents the cap style to use at the beginning of lines drawn with this Aspose.Imaging.Pen. この Aspose.Imaging.LineCap は、この Aspose.Imaging.Pen を使用するキャップスタイルを表しています。
endCap LineCap
A Aspose.Imaging.LineCap that represents the cap style to use at the end of lines drawn with this Aspose.Imaging.Pen. この Aspose.Imaging.LineCap は、この Aspose.Imaging.Pen を使用するキャップスタイルを表しています。
dashCap DashCap
A Aspose.Imaging.LineCap that represents the cap style to use at the beginning or end of dashed lines drawn with this Aspose.Imaging.Pen. この Aspose.Imaging.LineCap は、この Aspose.Imaging.Pen を使用するキャップスタイルを表しています。
TranslateTransform(フロア、フロア)
地元の地質学的変換を指定された次元によって翻訳するこの方法は、変換に翻訳を前提とする。
public void TranslateTransform(float dx, float dy)Parameters
dx float
x の翻訳の価値
dy float
翻訳の価値はY。
TranslateTransform(フラット、フラット、マトリックスオーダー)
地元の地質学的変換を指定された順序で指定された次元によって翻訳する。
public void TranslateTransform(float dx, float dy, MatrixOrder order)Parameters
dx float
x の翻訳の価値
dy float
翻訳の価値はY。
order MatrixOrder
翻訳を適用するオーダー(プレペンドまたはアペンド)