LinearGradientBrush

Inheritance: java.lang.Object, com.aspose.psd.DisposableObject, com.aspose.psd.Brush, com.aspose.psd.brushes.TransformBrush, com.aspose.psd.brushes.LinearGradientBrushBase

public final class LinearGradientBrush extends LinearGradientBrushBase

Encapsulates a Aspose.Imaging.Brush with a linear gradient. This class cannot be inherited.

Constructors

ConstructorDescription
LinearGradientBrush()Initializes a new instance of the LinearGradientBrush class with default parameters.
LinearGradientBrush(Point point1, Point point2, Color color1, Color color2)Initializes a new instance of the LinearGradientBrush class with the specified points and colors.
LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2)Initializes a new instance of the LinearGradientBrush class with the specified points and colors.
LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle)Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle)Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle, boolean isAngleScalable)Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle, boolean isAngleScalable)Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.

Methods

MethodDescription
close()Implements the Closable interface and can be used in the try-with-resources statement since JDK 1.7.
deepClone()Creates a new deep clone of the current Brush .
dispose()Disposes the current instance.
equals(Object arg0)
getAngle()Gets the gradient angle.
getBlend()Gets a Aspose.Imaging.Blend that specifies positions and factors that define a custom falloff for the gradient.
getClass()
getDisposed()Gets a value indicating whether this instance is disposed.
getEndColor()Gets the ending gradient color.
getGammaCorrection()Gets a value indicating whether gamma correction is enabled for this LinearGradientBrushBase .
getInterpolationColors()Gets a com.aspose.psd.ColorBlend that defines a multicolor linear gradient.
getLinearColors()Gets the starting and ending colors of the gradient.
getOpacity()Gets the brush opacity.
getRectangle()Gets a rectangular region that defines the starting and ending points of the gradient.
getStartColor()Gets the starting gradient color.
getTransform()Gets or sets a copy Aspose.Imaging.Matrix that defines a local geometric transform for this TransformBrush .
getWrapMode()Gets or sets a Aspose.Imaging.WrapMode enumeration that indicates the wrap mode for this TransformBrush .
hashCode()
isAngleScalable()Gets a value indicating whether LinearGradientBrushBase.Angle is changed during trasnformations with this LinearGradientBrushBase .
isTransformChanged()Gets a value indicating whether transformations were changed in some way.
multiplyTransform(Matrix matrix)Multiplies the Aspose.Imaging.Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Aspose.Imaging.Matrix by prepending the specified Aspose.Imaging.Matrix .
multiplyTransform(Matrix matrix, int order)Multiplies the Aspose.Imaging.Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Aspose.Imaging.Matrix in the specified order.
notify()
notifyAll()
resetTransform()Resets the TransformBrush.Transform property to identity.
rotateTransform(float angle)Rotates the local geometric transform by the specified amount.
rotateTransform(float angle, int order)Rotates the local geometric transform by the specified amount in the specified order.
scaleTransform(float sx, float sy)Scales the local geometric transform by the specified amounts.
scaleTransform(float sx, float sy, int order)Scales the local geometric transform by the specified amounts in the specified order.
setAngle(float value)Sets the gradient angle.
setAngleScalable(boolean value)Sets a value indicating whether LinearGradientBrushBase.Angle is changed during trasnformations with this LinearGradientBrushBase .
setBlend(Blend value)Sets a Aspose.Imaging.Blend that specifies positions and factors that define a custom falloff for the gradient.
setBlendTriangularShape(float focus)Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
setBlendTriangularShape(float focus, float scale)Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
setEndColor(Color value)Sets the ending gradient color.
setGammaCorrection(boolean value)Sets a value indicating whether gamma correction is enabled for this LinearGradientBrushBase .
setInterpolationColors(ColorBlend value)Sets a com.aspose.psd.ColorBlend that defines a multicolor linear gradient.
setLinearColors(Color[] value)Sets the starting and ending colors of the gradient.
setOpacity(float value)Sets the brush opacity.
setRectangle(RectangleF value)Sets a rectangular region that defines the starting and ending points of the gradient.
setSigmaBellShape(float focus)Creates a gradient falloff based on a bell-shaped curve.
setSigmaBellShape(float focus, float scale)Creates a gradient falloff based on a bell-shaped curve.
setStartColor(Color value)Sets the starting gradient color.
setTransform(Matrix value)Gets or sets a copy Aspose.Imaging.Matrix that defines a local geometric transform for this TransformBrush .
setWrapMode(int value)Gets or sets a Aspose.Imaging.WrapMode enumeration that indicates the wrap mode for this TransformBrush .
toString()
translateTransform(float dx, float dy)Translates the local geometric transform by the specified dimensions.
translateTransform(float dx, float dy, int order)Translates the local geometric transform by the specified dimensions in the specified order.
wait()
wait(long arg0)
wait(long arg0, int arg1)

LinearGradientBrush()

public LinearGradientBrush()

Initializes a new instance of the LinearGradientBrush class with default parameters. The starting color is black, the ending color is white, the angle is 45 degrees and the rectangle is located in (0,0) with size (1,1).

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

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

Initializes a new instance of the LinearGradientBrush class with the specified points and colors.

Parameters:

ParameterTypeDescription
point1PointA Aspose.Imaging.Point structure that represents the starting point of the linear gradient.
point2PointA Aspose.Imaging.Point structure that represents the endpoint of the linear gradient.
color1ColorA com.aspose.psd.Color structure that represents the starting color of the linear gradient.
color2ColorA com.aspose.psd.Color structure that represents the ending color of the linear gradient.

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

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

Initializes a new instance of the LinearGradientBrush class with the specified points and colors.

Parameters:

ParameterTypeDescription
point1PointFA Aspose.Imaging.PointF structure that represents the starting point of the linear gradient.
point2PointFA Aspose.Imaging.PointF structure that represents the endpoint of the linear gradient.
color1ColorA com.aspose.psd.Color structure that represents the starting color of the linear gradient.
color2ColorA com.aspose.psd.Color structure that represents the ending color of the linear gradient.

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

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

Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.

Parameters:

ParameterTypeDescription
rectRectangleA Aspose.Imaging.RectangleF structure that specifies the bounds of the linear gradient.
color1ColorA com.aspose.psd.Color structure that represents the starting color for the gradient.
color2ColorA com.aspose.psd.Color structure that represents the ending color for the gradient.
anglefloatThe angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line.

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

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

Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.

Parameters:

ParameterTypeDescription
rectRectangleFA Aspose.Imaging.RectangleF structure that specifies the bounds of the linear gradient.
color1ColorA com.aspose.psd.Color structure that represents the starting color for the gradient.
color2ColorA com.aspose.psd.Color structure that represents the ending color for the gradient.
anglefloatThe angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line.

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

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

Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.

Parameters:

ParameterTypeDescription
rectRectangleA Aspose.Imaging.RectangleF structure that specifies the bounds of the linear gradient.
color1ColorA com.aspose.psd.Color structure that represents the starting color for the gradient.
color2ColorA com.aspose.psd.Color structure that represents the ending color for the gradient.
anglefloatThe angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line.
isAngleScalablebooleanif set to true the angle is changed during transformations with this LinearGradientBrush .

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

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

Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.

Parameters:

ParameterTypeDescription
rectRectangleFA Aspose.Imaging.RectangleF structure that specifies the bounds of the linear gradient.
color1ColorA com.aspose.psd.Color structure that represents the starting color for the gradient.
color2ColorA com.aspose.psd.Color structure that represents the ending color for the gradient.
anglefloatThe angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line.
isAngleScalablebooleanif set to true the angle is changed during transformations with this LinearGradientBrush .

close()

public void close()

Implements the Closable interface and can be used in the try-with-resources statement since JDK 1.7. This method simply call dispose method.

deepClone()

public Brush deepClone()

Creates a new deep clone of the current Brush .

Returns: Brush - A new Brush which is the deep clone of this Brush instance.

dispose()

public final void dispose()

Disposes the current instance.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAngle()

public float getAngle()

Gets the gradient angle.

Returns: float - The gradient angle.

getBlend()

public Blend getBlend()

Gets a Aspose.Imaging.Blend that specifies positions and factors that define a custom falloff for the gradient.

Returns: Blend - A Aspose.Imaging.Blend that represents a custom falloff for the gradient.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getDisposed()

public final boolean getDisposed()

Gets a value indicating whether this instance is disposed.

Returns: boolean - true if disposed; otherwise, false .

getEndColor()

public Color getEndColor()

Gets the ending gradient color.

Returns: Color - The ending gradient color.

getGammaCorrection()

public boolean getGammaCorrection()

Gets a value indicating whether gamma correction is enabled for this LinearGradientBrushBase .

Returns: boolean - The value is true if gamma correction is enabled for this LinearGradientBrushBase ; otherwise, false.

getInterpolationColors()

public ColorBlend getInterpolationColors()

Gets a com.aspose.psd.ColorBlend that defines a multicolor linear gradient.

Returns: ColorBlend - A com.aspose.psd.ColorBlend that defines a multicolor linear gradient.

getLinearColors()

public Color[] getLinearColors()

Gets the starting and ending colors of the gradient.

Returns: com.aspose.psd.Color[] - An array of two Color structures that represents the starting and ending colors of the gradient.

getOpacity()

public float getOpacity()

Gets the brush opacity. The value should be between 0 and 1. Value of 0 means that brush is fully visible, value of 1 means the brush is fully opaque.

Returns: float - The brush opacity value.

getRectangle()

public RectangleF getRectangle()

Gets a rectangular region that defines the starting and ending points of the gradient.

Returns: RectangleF - A com.aspose.psd.RectangleF structure that specifies the starting and ending points of the gradient.

getStartColor()

public Color getStartColor()

Gets the starting gradient color.

Returns: Color - The starting gradient color.

getTransform()

public Matrix getTransform()

Gets or sets a copy Aspose.Imaging.Matrix that defines a local geometric transform for this TransformBrush .

Returns: Matrix - A copy of the Aspose.Imaging.Matrix that defines a geometric transform that applies only to fills drawn with this TransformBrush .

getWrapMode()

public int getWrapMode()

Gets or sets a Aspose.Imaging.WrapMode enumeration that indicates the wrap mode for this TransformBrush .

Returns: int - A Aspose.Imaging.WrapMode that specifies how fills drawn with this TransformBrush are tiled.

hashCode()

public native int hashCode()

Returns: int

isAngleScalable()

public boolean isAngleScalable()

Gets a value indicating whether LinearGradientBrushBase.Angle is changed during trasnformations with this LinearGradientBrushBase .

Returns: boolean - true if LinearGradientBrushBase.Angle is changed during transformations with this LinearGradientBrushBase ; otherwise, false .

isTransformChanged()

public boolean isTransformChanged()

Gets a value indicating whether transformations were changed in some way. For example setting the transformation matrix or calling any of the methods altering the transformation matrix. The property is introduced for backward compatibility with GDI+.

Value: True if transformation was changed; otherwise, false .

Returns: boolean

multiplyTransform(Matrix matrix)

public void multiplyTransform(Matrix matrix)

Multiplies the Aspose.Imaging.Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Aspose.Imaging.Matrix by prepending the specified Aspose.Imaging.Matrix .

Parameters:

ParameterTypeDescription
matrixMatrixThe Aspose.Imaging.Matrix by which to multiply the geometric transform.

multiplyTransform(Matrix matrix, int order)

public void multiplyTransform(Matrix matrix, int order)

Multiplies the Aspose.Imaging.Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Aspose.Imaging.Matrix in the specified order.

Parameters:

ParameterTypeDescription
matrixMatrixThe Aspose.Imaging.Matrix by which to multiply the geometric transform.
orderintA Aspose.Imaging.MatrixOrder that specifies in which order to multiply the two matrices.

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

resetTransform()

public void resetTransform()

Resets the TransformBrush.Transform property to identity.

rotateTransform(float angle)

public void rotateTransform(float angle)

Rotates the local geometric transform by the specified amount. This method prepends the rotation to the transform.

Parameters:

ParameterTypeDescription
anglefloatThe angle of rotation.

rotateTransform(float angle, int order)

public void rotateTransform(float angle, int order)

Rotates the local geometric transform by the specified amount in the specified order.

Parameters:

ParameterTypeDescription
anglefloatThe angle of rotation.
orderintA Aspose.Imaging.MatrixOrder that specifies whether to append or prepend the rotation matrix.

scaleTransform(float sx, float sy)

public void scaleTransform(float sx, float sy)

Scales the local geometric transform by the specified amounts. This method prepends the scaling matrix to the transform.

Parameters:

ParameterTypeDescription
sxfloatThe amount by which to scale the transform in the x-axis direction.
syfloatThe amount by which to scale the transform in the y-axis direction.

scaleTransform(float sx, float sy, int order)

public void scaleTransform(float sx, float sy, int order)

Scales the local geometric transform by the specified amounts in the specified order.

Parameters:

ParameterTypeDescription
sxfloatThe amount by which to scale the transform in the x-axis direction.
syfloatThe amount by which to scale the transform in the y-axis direction.
orderintA Aspose.Imaging.MatrixOrder that specifies whether to append or prepend the scaling matrix.

setAngle(float value)

public void setAngle(float value)

Sets the gradient angle.

Parameters:

ParameterTypeDescription
valuefloatThe gradient angle.

setAngleScalable(boolean value)

public void setAngleScalable(boolean value)

Sets a value indicating whether LinearGradientBrushBase.Angle is changed during trasnformations with this LinearGradientBrushBase .

Parameters:

ParameterTypeDescription
valuebooleantrue if LinearGradientBrushBase.Angle is changed during transformations with this LinearGradientBrushBase ; otherwise, false .

setBlend(Blend value)

public void setBlend(Blend value)

Sets a Aspose.Imaging.Blend that specifies positions and factors that define a custom falloff for the gradient.

Parameters:

ParameterTypeDescription
valueBlendA Aspose.Imaging.Blend that represents a custom falloff for the gradient.

setBlendTriangularShape(float focus)

public void setBlendTriangularShape(float focus)

Creates a linear gradient with a center color and a linear falloff to a single color on both ends.

Parameters:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).

setBlendTriangularShape(float focus, float scale)

public void setBlendTriangularShape(float focus, float scale)

Creates a linear gradient with a center color and a linear falloff to a single color on both ends.

Parameters:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).
scalefloatA value from 0 through1 that specifies how fast the colors falloff from the starting color to focus (ending color)

setEndColor(Color value)

public void setEndColor(Color value)

Sets the ending gradient color.

Parameters:

ParameterTypeDescription
valueColorThe ending gradient color.

setGammaCorrection(boolean value)

public void setGammaCorrection(boolean value)

Sets a value indicating whether gamma correction is enabled for this LinearGradientBrushBase .

Parameters:

ParameterTypeDescription
valuebooleanThe value is true if gamma correction is enabled for this LinearGradientBrushBase ; otherwise, false.

setInterpolationColors(ColorBlend value)

public void setInterpolationColors(ColorBlend value)

Sets a com.aspose.psd.ColorBlend that defines a multicolor linear gradient.

Parameters:

ParameterTypeDescription
valueColorBlendA com.aspose.psd.ColorBlend that defines a multicolor linear gradient.

setLinearColors(Color[] value)

public void setLinearColors(Color[] value)

Sets the starting and ending colors of the gradient.

Parameters:

ParameterTypeDescription
valueColor[]An array of two Color structures that represents the starting and ending colors of the gradient.

setOpacity(float value)

public void setOpacity(float value)

Sets the brush opacity. The value should be between 0 and 1. Value of 0 means that brush is fully visible, value of 1 means the brush is fully opaque.

Parameters:

ParameterTypeDescription
valuefloatThe brush opacity value.

setRectangle(RectangleF value)

public void setRectangle(RectangleF value)

Sets a rectangular region that defines the starting and ending points of the gradient.

Parameters:

ParameterTypeDescription
valueRectangleFA com.aspose.psd.RectangleF structure that specifies the starting and ending points of the gradient.

setSigmaBellShape(float focus)

public void setSigmaBellShape(float focus)

Creates a gradient falloff based on a bell-shaped curve.

Parameters:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies the center of the gradient (the point where the starting color and ending color are blended equally).

setSigmaBellShape(float focus, float scale)

public void setSigmaBellShape(float focus, float scale)

Creates a gradient falloff based on a bell-shaped curve.

Parameters:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).
scalefloatA value from 0 through 1 that specifies how fast the colors falloff from the focus .

setStartColor(Color value)

public void setStartColor(Color value)

Sets the starting gradient color.

Parameters:

ParameterTypeDescription
valueColorThe starting gradient color.

setTransform(Matrix value)

public void setTransform(Matrix value)

Gets or sets a copy Aspose.Imaging.Matrix that defines a local geometric transform for this TransformBrush .

Parameters:

ParameterTypeDescription
valueMatrix

setWrapMode(int value)

public void setWrapMode(int value)

Gets or sets a Aspose.Imaging.WrapMode enumeration that indicates the wrap mode for this TransformBrush .

Parameters:

ParameterTypeDescription
valueint

toString()

public String toString()

Returns: java.lang.String

translateTransform(float dx, float dy)

public void translateTransform(float dx, float dy)

Translates the local geometric transform by the specified dimensions. This method prepends the translation to the transform.

Parameters:

ParameterTypeDescription
dxfloatThe value of the translation in x.
dyfloatThe value of the translation in y.

translateTransform(float dx, float dy, int order)

public void translateTransform(float dx, float dy, int order)

Translates the local geometric transform by the specified dimensions in the specified order.

Parameters:

ParameterTypeDescription
dxfloatThe value of the translation in x.
dyfloatThe value of the translation in y.
orderintThe order (prepend or append) in which to apply the translation.

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int