CircleMask

Inheritance: java.lang.Object, com.aspose.imaging.magicwand.imagemasks.ImageMask

public class CircleMask extends ImageMask

Describes a circle mask.

Constructors

ConstructorDescription
CircleMask(int x, int y, int radius)Initializes a new instance of the CircleMask class with the specified center point and radius.
CircleMask(Point center, int radius)Initializes a new instance of the CircleMask class with the specified center point and radius.

Methods

MethodDescription
getSelectionBounds()Gets the bounds, in pixels, of this mask.
get_Item(int x, int y)Gets the opacity of the specified pixel.
inflate(int size)Inflates this mask by the specified amount.
crop(Rectangle rectangle)Crops mask with the specified rectangle.
deepClone()Creates a new object that is a copy of the current instance.

CircleMask(int x, int y, int radius)

public CircleMask(int x, int y, int radius)

Initializes a new instance of the CircleMask class with the specified center point and radius.

Parameters:

ParameterTypeDescription
xintThe x-coordinate of the center point of the selected area.
yintThe y-coordinate of the center point of the selected area.
radiusintRadius of the selected area.

CircleMask(Point center, int radius)

public CircleMask(Point center, int radius)

Initializes a new instance of the CircleMask class with the specified center point and radius.

Parameters:

ParameterTypeDescription
centerPointThe center point of the selected area.
radiusintRadius of the selected area.

getSelectionBounds()

public Rectangle getSelectionBounds()

Gets the bounds, in pixels, of this mask.

Returns: Rectangle - the bounds, in pixels, of this mask.

get_Item(int x, int y)

public boolean get_Item(int x, int y)

Gets the opacity of the specified pixel.

Parameters:

ParameterTypeDescription
xintThe x-coordinate of the pixel.
yintThe y-coordinate of the pixel.

Returns: boolean - true if the specified pixel is opaque; otherwise, false.

inflate(int size)

public ImageMask inflate(int size)

Inflates this mask by the specified amount.

Parameters:

ParameterTypeDescription
sizeintThe amount to inflate this mask.

Returns: ImageMask - An inflated CircleMask as ImageMask.

crop(Rectangle rectangle)

public ImageMask crop(Rectangle rectangle)

Crops mask with the specified rectangle.

Parameters:

ParameterTypeDescription
rectangleRectangleThe specified rectangle.

Returns: ImageMask - A cropped CircleMask or ImageBitMask as ImageMask. As ImageBitMask may be returned, fluent call is recommended.

deepClone()

public Object deepClone()

Creates a new object that is a copy of the current instance.

Returns: java.lang.Object - A new object that is a copy of this instance.