com.aspose.imaging.brushes
Class LinearGradientBrush

java.lang.Object
  extended by com.aspose.imaging.DisposableObject
      extended by com.aspose.imaging.Brush
          extended by com.aspose.imaging.brushes.TransformBrush
              extended by com.aspose.imaging.brushes.LinearGradientBrushBase
                  extended by com.aspose.imaging.brushes.LinearGradientBrush

public final class LinearGradientBrush
extends LinearGradientBrushBase

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


Constructor Summary
LinearGradientBrush()
           Initializes a new instance of the LinearGradientBrush class with default parameters.
LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2)
           Initializes a new instance of the LinearGradientBrush class with the specified points and colors.
LinearGradientBrush(Point point1, Point 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)
           Creates 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)
           Creates 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)
           Creates 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)
           Creates a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
 
Method Summary
 Blend getBlend()
           Gets or sets a Blend that specifies positions and factors that define a custom falloff for the gradient.
 Color getEndColor()
           Gets or sets the ending gradient color.
 ColorBlend getInterpolationColors()
          Deprecated. 
 Color[] getLinearColors()
          Deprecated. 
 Color getStartColor()
           Gets or sets the starting gradient color.
 void setBlend(Blend value)
           
 void setBlendTriangularShape(float focus)
           Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
 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.
 void setEndColor(Color value)
           
 void setInterpolationColors(ColorBlend value)
          Deprecated. 
 void setLinearColors(Color[] value)
          Deprecated. 
 void setSigmaBellShape(float focus)
           Creates a gradient falloff based on a bell-shaped curve.
 void setSigmaBellShape(float focus, float scale)
           Creates a gradient falloff based on a bell-shaped curve.
 void setStartColor(Color value)
           
 
Methods inherited from class com.aspose.imaging.brushes.LinearGradientBrushBase
getAngle, getGammaCorrection, getRectangle, isAngleScalable, isAngleScalable, setAngle, setGammaCorrection, setRectangle_Rename_Namesake
 
Methods inherited from class com.aspose.imaging.brushes.TransformBrush
getTransform, getWrapMode, isTransformChanged, multiplyTransform, multiplyTransform, resetTransform, rotateTransform, rotateTransform, scaleTransform, scaleTransform, setTransform, setWrapMode, translateTransform, translateTransform
 
Methods inherited from class com.aspose.imaging.Brush
deepClone, getOpacity, setOpacity
 
Methods inherited from class com.aspose.imaging.DisposableObject
dispose, getDisposed, releaseManagedResources, releaseUnmanagedResources, verifyNotDisposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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

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:
point1 - A PointF structure that represents the starting point of the linear gradient.
point2 - A PointF structure that represents the endpoint of the linear gradient.
color1 - A Color structure that represents the starting color of the linear gradient.
color2 - A Color structure that represents the ending color of the linear gradient.

LinearGradientBrush

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:
point1 - A Point structure that represents the starting point of the linear gradient.
point2 - A Point structure that represents the endpoint of the linear gradient.
color1 - A Color structure that represents the starting color of the linear gradient.
color2 - A Color structure that represents the ending color of the linear gradient.

LinearGradientBrush

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

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

Parameters:
rect - A RectangleF structure that specifies the bounds of the linear gradient.
color1 - A Color structure that represents the starting color for the gradient.
color2 - A Color structure that represents the ending color for the gradient.
angle - The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.

LinearGradientBrush

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

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

Parameters:
rect - A RectangleF structure that specifies the bounds of the linear gradient.
color1 - A Color structure that represents the starting color for the gradient.
color2 - A Color structure that represents the ending color for the gradient.
angle - The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.
isAngleScalable - if set to true the angle is changed during trasnformations with this LinearGradientBrush.

LinearGradientBrush

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

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

Parameters:
rect - A RectangleF structure that specifies the bounds of the linear gradient.
color1 - A Color structure that represents the starting color for the gradient.
color2 - A Color structure that represents the ending color for the gradient.
angle - The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.

LinearGradientBrush

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

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

Parameters:
rect - A RectangleF structure that specifies the bounds of the linear gradient.
color1 - A Color structure that represents the starting color for the gradient.
color2 - A Color structure that represents the ending color for the gradient.
angle - The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.
isAngleScalable - if set to true the angle is changed during trasnformations with this LinearGradientBrush.
Method Detail

getBlend

public Blend getBlend()

Gets or sets a Blend that specifies positions and factors that define a custom falloff for the gradient.

Value: A Blend that represents a custom falloff for the gradient.


getEndColor

public Color getEndColor()

Gets or sets the ending gradient color.

Value: The ending gradient color.


getInterpolationColors

@Deprecated
public ColorBlend getInterpolationColors()
Deprecated. 

Gets or sets a ColorBlend that defines a multicolor linear gradient.

Value: A ColorBlend that defines a multicolor linear gradient.


getLinearColors

@Deprecated
public Color[] getLinearColors()
Deprecated. 

Gets or sets the starting and ending colors of the gradient.

Value: An array of two Color structures that represents the starting and ending colors of the gradient.


getStartColor

public Color getStartColor()

Gets or sets the starting gradient color.

Value: The starting gradient color.


setBlend

public void setBlend(Blend value)

setBlendTriangularShape

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:
focus - A 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

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:
focus - A value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).
scale - A value from 0 through1 that specifies how fast the colors falloff from the starting color to focus (ending color)

setEndColor

public void setEndColor(Color value)

setInterpolationColors

@Deprecated
public void setInterpolationColors(ColorBlend value)
Deprecated. 


setLinearColors

@Deprecated
public void setLinearColors(Color[] value)
Deprecated. 


setSigmaBellShape

public void setSigmaBellShape(float focus)

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

Parameters:
focus - A 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

public void setSigmaBellShape(float focus,
                              float scale)

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

Parameters:
focus - A value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).
scale - A value from 0 through 1 that specifies how fast the colors falloff from the focus.

setStartColor

public void setStartColor(Color value)