Class Pen
이름 공간 : Aspose.Imaging 모임: Aspose.Imaging.dll (25.4.0)
라인, 곡선 및 숫자를 그리는 데 사용되는 개체를 정의합니다.
public class Pen : TransparencySupporter
Inheritance
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의 색깔을 나타내는 Aspose.Imaging.Pen 구조.
Pen(색상, 플로트)
Aspose.Imaging.Pen 클래스의 새로운 예를 Aspose.Imaging.Pen 클래스의 특정 Aspose.Imaging.Pen.Color 및 Aspose.Imaging.Pen.Width 속성으로 시작합니다.
public Pen(Color color, float width)
Parameters
color
Color
이 Aspose.Imaging.Pen의 색깔을 나타내는 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 클래스의 지정된 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과 함께 끌린 두 개의 연속 라인의 끝에 대한 합류 스타일을 얻거나 설정합니다.
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(플로트, MatrixOrder)
지정된 순서의 지정된 각도에서 지역 지질 변환을 회전합니다.
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-axis 방향으로 변환을 확장하는 요소입니다.
sy
float
Y-axis 방향으로 변환을 확장하는 요소.
ScaleTransform(플로트, 플로트, MatrixOrder)
지정된 순서의 지정된 요소에 따라 지역 지질 변환을 측정합니다.
public void ScaleTransform(float sx, float sy, MatrixOrder order)
Parameters
sx
float
X-axis 방향으로 변환을 확장하는 요소입니다.
sy
float
Y-axis 방향으로 변환을 확장하는 요소.
order
MatrixOrder
Aspose.Imaging.MatrixOrder는 스케일링 매트릭스를 첨부하거나 첨부하는지 여부를 지정합니다.
SetLineCap(라인 캡, 라인 캡, DashCap)
이 Aspose.Imaging.Pen에 의해 추출 된 끝 라인에 사용 된 캡의 스타일을 결정하는 값을 설정합니다.
public void SetLineCap(LineCap startCap, LineCap endCap, DashCap dashCap)
Parameters
startCap
LineCap
Aspose.Imaging.LineCap 이 Aspose.Imaging.Pen과 함께 끌린 라인의 시작 부분에서 사용하는 캡 스타일을 나타냅니다.
endCap
LineCap
Aspose.Imaging.LineCap 이 Aspose.Imaging.Pen과 함께 끌린 라인의 끝에서 사용할 수있는 캡 스타일을 나타냅니다.
dashCap
DashCap
Aspose.Imaging.LineCap 이 Aspose.Imaging.Pen 이와 함께 끌린 끈의 시작 또는 끝에서 사용하는 캡 스타일을 나타냅니다.
TranslateTransform(수영장, 수영장)
현지 지질학적 변환을 지정된 차원에 따라 번역합니다.이 방법은 번역을 변환에 의존합니다.
public void TranslateTransform(float dx, float dy)
Parameters
dx
float
번역의 값은 x입니다.
dy
float
번역의 가치 Y.
TranslateTransform(플로트, 플로트, MatrixOrder)
지정된 순서에서 지정된 차원에 따라 지역 지질 변환을 번역합니다.
public void TranslateTransform(float dx, float dy, MatrixOrder order)
Parameters
dx
float
번역의 값은 x입니다.
dy
float
번역의 가치 Y.
order
MatrixOrder
번역을 적용하는 명령 (prepend 또는 append)