Class LinearGradientBrush

Class LinearGradientBrush

이름 공간 : Aspose.Imaging.Brushes 모임: Aspose.Imaging.dll (25.4.0)

Aspose.Imaging.Brush를 선형 그라디언트로 캡슐화합니다.이 클래스는 유산되지 않습니다.

[JsonObject(MemberSerialization.OptIn)]
public sealed class LinearGradientBrush : LinearGradientBrushBase, IDisposable

Inheritance

object DisposableObject Brush TransformBrush LinearGradientBrushBase LinearGradientBrush

Implements

IDisposable

상속 회원들

LinearGradientBrushBase.Rectangle , LinearGradientBrushBase.Angle , LinearGradientBrushBase.IsAngleScalable , LinearGradientBrushBase.GammaCorrection , TransformBrush.ResetTransform() , TransformBrush.MultiplyTransform(Matrix) , TransformBrush.MultiplyTransform(Matrix, MatrixOrder) , TransformBrush.TranslateTransform(float, float) , TransformBrush.TranslateTransform(float, float, MatrixOrder) , TransformBrush.ScaleTransform(float, float) , TransformBrush.ScaleTransform(float, float, MatrixOrder) , TransformBrush.RotateTransform(float) , TransformBrush.RotateTransform(float, MatrixOrder) , TransformBrush.WrapMode , TransformBrush.Transform , TransformBrush.IsTransformChanged , Brush.DeepClone() , Brush.Equals(object) , Brush.GetHashCode() , Brush.Opacity , DisposableObject.Dispose() , DisposableObject.Disposed , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

LinearGradientBrush(RectangleF, 색상, 색상, 플로트, 볼)

Aspose.Imaging.Brushes.LinearGradientBrush 클래스의 새로운 사례를 시작합니다.

public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle, bool isAngleScalable)

Parameters

rect RectangleF

오른쪽 쪽 쪽

color1 Color

색상 1

color2 Color

색상 2

angle float

그 각도는

isAngleScalable bool

만일 그가 ‘진실’이라면

LinearGradientBrush(Rectangle, 색상, 색상, 플로트, 볼)

Aspose.Imaging.Brushes.LinearGradientBrush 클래스의 새로운 사례를 시작합니다.

public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle, bool isAngleScalable)

Parameters

rect Rectangle

오른쪽 쪽 쪽

color1 Color

색상 1

color2 Color

색상 2

angle float

그 각도는

isAngleScalable bool

만일 그가 ‘진실’이라면

LinearGradientBrush(RectangleF, 색상, 색상, 플로트)

Aspose.Imaging.Brushes.LinearGradientBrush 클래스의 새로운 사례를 시작합니다.

public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle)

Parameters

rect RectangleF

오른쪽 쪽 쪽

color1 Color

색상 1

color2 Color

색상 2

angle float

그 각도는

LinearGradientBrush(오른쪽, 색상, 색상, 플로트)

Aspose.Imaging.Brushes.LinearGradientBrush 클래스의 새로운 사례를 시작합니다.

public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle)

Parameters

rect Rectangle

오른쪽 쪽 쪽

color1 Color

색상 1

color2 Color

색상 2

angle float

그 각도는

LinearGradientBrush(포인트 F, 포인트 F, 색상)

Aspose.Imaging.Brushes.LinearGradientBrush 클래스의 새로운 사례를 시작합니다.

public LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2)

Parameters

point1 PointF

포인트 1

point2 PointF

포인트 2

color1 Color

색상 1

color2 Color

색상 2

LinearGradientBrush(포인트, 포인트, 색상)

Aspose.Imaging.Brushes.LinearGradientBrush 클래스의 새로운 사례를 시작합니다.

public LinearGradientBrush(Point point1, Point point2, Color color1, Color color2)

Parameters

point1 Point

포인트 1

point2 Point

포인트 2

color1 Color

색상 1

color2 Color

색상 2

Examples

다음 예제는 기존 프레임의 그레이 스케일 복사본을 만드는 방법을 보여주고 TIFF 이미지에 추가합니다.

string dir = "c:\\temp\\";

                                                                                                                      Aspose.Imaging.ImageOptions.TiffOptions createTiffOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);

                                                                                                                      // Create a permanent, not temporary file source.
                                                                                                                      createTiffOptions.Source = new Aspose.Imaging.Sources.FileCreateSource(dir + "multipage.tif", false);
                                                                                                                      createTiffOptions.Photometric = Aspose.Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.Rgb;
                                                                                                                      createTiffOptions.BitsPerSample = new ushort[] { 8, 8, 8 };

                                                                                                                      using (Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)Image.Create(createTiffOptions, 100, 100))
                                                                                                                      {
                                                                                                                          // The linear gradient from the left-top to the right-bottom corner of the image.
                                                                                                                          Aspose.Imaging.Brushes.LinearGradientBrush brush =
                                                                                                                              new Aspose.Imaging.Brushes.LinearGradientBrush(
                                                                                                                                  new Aspose.Imaging.Point(0, 0),
                                                                                                                                  new Aspose.Imaging.Point(tiffImage.Width, tiffImage.Height),
                                                                                                                                  Aspose.Imaging.Color.Red,
                                                                                                                                  Aspose.Imaging.Color.Green);

                                                                                                                          // Fill the active frame with a linear gradient brush.
                                                                                                                          Aspose.Imaging.Graphics gr = new Aspose.Imaging.Graphics(tiffImage.ActiveFrame);
                                                                                                                          gr.FillRectangle(brush, tiffImage.Bounds);

                                                                                                                          // Grayscale options
                                                                                                                          Aspose.Imaging.ImageOptions.TiffOptions createTiffFrameOptions = new Aspose.Imaging.ImageOptions.TiffOptions(Aspose.Imaging.FileFormats.Tiff.Enums.TiffExpectedFormat.Default);
                                                                                                                          createTiffFrameOptions.Source = new Aspose.Imaging.Sources.StreamSource(new System.IO.MemoryStream());
                                                                                                                          createTiffFrameOptions.Photometric = Imaging.FileFormats.Tiff.Enums.TiffPhotometrics.MinIsBlack;
                                                                                                                          createTiffFrameOptions.BitsPerSample = new ushort[] { 8 };

                                                                                                                          // Create a grayscale copy of the active frame.
                                                                                                                          // The pixel data is preserved but converted to the desired format.
                                                                                                                          Aspose.Imaging.FileFormats.Tiff.TiffFrame grayscaleFrame = Aspose.Imaging.FileFormats.Tiff.TiffFrame.CreateFrameFrom(tiffImage.ActiveFrame, createTiffFrameOptions);

                                                                                                                          // Add the newly created frame to the TIFF image.
                                                                                                                          tiffImage.AddFrame(grayscaleFrame);

                                                                                                                          tiffImage.Save();
                                                                                                                      }

LinearGradientBrush()

기본 매개 변수와 함께 Aspose.Imaging.Brushes.LinearGradientBrush 클래스의 새로운 예를 시작합니다.출발 색상은 검정색, 끝 색상은 흰색, 각도는 45도이며 직경은 크기 (1,1)로 (0,0)에 위치하고 있습니다.

public LinearGradientBrush()

Properties

Blend

그것은 Aspose.Imaging.Blend를 얻거나 설정하여 그라디언을위한 사용자 지정된 falloff를 정의하는 위치와 요소를 지정합니다.

public Blend Blend { get; set; }

부동산 가치

Blend

EndColor

그것은 그레이딩 색을 얻거나 설정합니다.

public Color EndColor { get; set; }

부동산 가치

Color

InterpolationColors

다채로운 선형 그라디언트를 정의하는 Aspose.Imaging.ColorBlend를 얻거나 설정합니다.

[Obsolete("This property is not used anymore in this class. Use instance of the LinearMulticolorGradientBrush class instead.")]
[JsonIgnore]
public ColorBlend InterpolationColors { get; set; }

부동산 가치

ColorBlend

LinearColors

그라디언트의 시작 및 끝 색상을 얻거나 설정합니다.

[Obsolete("Use StartColor and EndColor properties instead.")]
[JsonIgnore]
public Color[] LinearColors { get; set; }

부동산 가치

Color [ ] [ [ ]

StartColor

그것은 그라디언의 시작 색을 얻거나 설정합니다.

public Color StartColor { get; set; }

부동산 가치

Color

Methods

SetBlendTriangularShape(플로트)

그것은 중앙 색깔을 가진 선형 그라디언트와 양쪽 끝에 하나의 색깔에 대한 선형 팔로프를 만듭니다.

public void SetBlendTriangularShape(float focus)

Parameters

focus float

0에서 1까지의 값은 그라디언트의 중심을 지정합니다 (그라디언트가 단지 끝 색으로 구성된 지점).

SetBlendTriangularShape(수영장, 수영장)

그것은 중앙 색깔을 가진 선형 그라디언트와 양쪽 끝에 하나의 색깔에 대한 선형 팔로프를 만듭니다.

public void SetBlendTriangularShape(float focus, float scale)

Parameters

focus float

0에서 1까지의 값은 그라디언트의 중심을 지정합니다 (그라디언트가 단지 끝 색으로 구성된 지점).

scale float

0에서 1까지의 값은 색상이 시작 색상에서 focus’ (결말 색상)로 얼마나 빠르게 떨어지는지 지정합니다.

SetSigmaBellShape(플로트)

그것은 벨 모양의 곡선을 기반으로 한 그라디언트 팔로프를 만듭니다.

public void SetSigmaBellShape(float focus)

Parameters

focus float

0에서 1까지의 값은 그라디언트의 중심을 지정합니다 (초기 색상과 끝 색상이 동일하게 혼합되는 지점).

SetSigmaBellShape(수영장, 수영장)

그것은 벨 모양의 곡선을 기반으로 한 그라디언트 팔로프를 만듭니다.

public void SetSigmaBellShape(float focus, float scale)

Parameters

focus float

0에서 1까지의 값은 그라디언트의 중심을 지정합니다 (그라디언트가 단지 끝 색으로 구성된 지점).

scale float

0에서 1까지의 값은 focus"에서 색상이 얼마나 빠르게 떨어지는지 지정합니다.

 한국어