Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

Interface IPaint

interface IPaint
Extends com.amazon.apmf.IStandard The IPaint interface holds the style and color information about how to draw geometries etc.

Methods

getStyle()

PaintStyle getStyle()
This method returns the painting style currently set for the IPaint object.

Returns

PaintStyle The current painting style, specified by the PaintStyle enum.

getAlpha()

float getAlpha()
This method returns the alpha (transparency) value, which represents the transparency level of the IPaint.

Returns

float The alpha value of the IPaint, specified as a float

getColor()

Color getColor()
This method returns the Color currently set for the IPaint object.

Returns

Color The current Color, represented as a Color object.

getStrokeCap()

StrokeCap getStrokeCap()
This method returns the stroke end cap style currently set for the IPaint object.

Returns

StrokeCap The current stroke end cap style, specified by the StrokeCap enum.

getStrokeJoin()

StrokeJoin getStrokeJoin()
This method returns the stroke join style currently set for the IPaint object.

Returns

StrokeJoin The current stroke join style, specified by the StrokeJoin enum.

getStrokeMiter()

float getStrokeMiter()
This method returns the stroke miter limit currently set for the IPaint object.

Returns

float The current stroke miter limit, specified as a floating-point value.

getStrokeWidth()

float getStrokeWidth()
This method returns the width of the stroke currently set for the IPaint object.

Returns

float The current stroke width, specified as a floating-point value.

getBlendMode()

BlendMode getBlendMode()
This method returns the blend mode currently set for the IPaint object.

Returns

BlendMode The current blend mode, specified by the BlendMode enum.

isAntiAlias()

bool isAntiAlias()
This method checks whether anti-aliasing is enabled for the IPaint object.

Returns

bool True if anti-aliasing is enabled, false otherwise.

getShader()

IShader? getShader()
This method returns the IShader associated with the IPaint object. In case there is no shader associated with the paint object, this will return nullptr.

Returns

IShader? The return value is optional and might be absent. The IShader instance associated with this IPaint object.

getMaskFilter()

IMaskFilter? getMaskFilter()
This method returns the mask filter associated with the IPaint object. In case there is no Mask Filter associated with the paint object, this will return nullptr.

Returns

IMaskFilter? The return value is optional and might be absent. The IMaskFilter instance associated with this IPaint object.

getPathEffect()

IPathEffect? getPathEffect()
This method returns the IPathEffect associated with the paint object. In case there is no path Effect associated with the paint object, this will return nullptr.

Returns

IPathEffect? The return value is optional and might be absent. The IPathEffect instance associated with this IPaint object.

getColorFilter()

IColorFilter? getColorFilter()
This method returns the IColorFilter associated with the paint object. In case there is no color filter associated with the paint object, this will return nullptr.

Returns

IColorFilter? The return value is optional and might be absent. The IColorFilter instance associated with this IPaint object.

setStyle()

void setStyle(PaintStyle style)
This method sets the painting style for the IPaint.

Parameters

style
PaintStyle — Required PaintStyle object representing the desired styling. PaintStyle

setAlpha()

void setAlpha(float alpha)
This method sets the alpha (transparency) value for the IPaint. The alpha value determines the transparency level of the IPaint, where 0 is fully transparent and 1 is fully opaque. Any out of range values will be clamped between 0 and 1 including.

Parameters

alpha
float — Required The alpha value to set, specified as a float.

setAntiAlias()

void setAntiAlias(bool antiAlias)
This method enables or disables anti-aliasing for the IPaint. Anti-aliasing smooths the edges of the IPaint to reduce the visual artifacts known as aliasing.

Parameters

antiAlias
bool — Required A boolean value to enable or disable anti-aliasing.

setColor()

void setColor(Color* color)
This method sets the Color for the IPaint.

Parameters

color
Color* — Required The Color to set, specified as a Color object.

setShader()

void setShader(IShader* shader)
This method sets the IShader for the IPaint. A IShader is used to define advanced color effects or patterns for the IPaint.

Parameters

shader
IShader* — Required The IShader object to be set. IShader

setStrokeCap()

void setStrokeCap(StrokeCap cap)
This method sets the stroke end cap style for the IPaint. The end cap determines the shape used at the end of lines or paths.

Parameters

cap
StrokeCap — Required The stroke end cap style to set, defined by the StrokeCap enum. StrokeCap

setStrokeJoin()

void setStrokeJoin(StrokeJoin join)
This method sets the style of the joins between connected segments of a IPath for strokes made by the IPaintBuilder. The join style determines the shape used at the junction of two segments.

Parameters

join
StrokeJoin — Required The stroke join style to set, defined by the StrokeJoin enum. StrokeJoin

setStrokeMiter()

void setStrokeMiter(float miter)
This method sets the stroke miter limit for the IPaint. The miter limit controls the maximum length of the miter join’s spike, where two lines meet at a sharp angle.

Parameters

miter
float — Required The miter limit to set, specified as a floating-point value.

setColorFilter()

void setColorFilter(IColorFilter* colorFilter)
This method sets the IColorFilter for the IPaint. A IColorFilter can modify the color of the IPaint before it is applied, allowing for effects such as changing the hue, saturation, brightness, or applying blending modes.

Parameters

colorFilter
IColorFilter* — Required The IColorFilter object to be set. IColorFilter

setPathEffect()

void setPathEffect(IPathEffect* pathEffect)
This method sets the IPathEffect for the IPaint. A IPathEffect can alter the geometry of the drawing IPath before it is rendered, allowing for effects such as dashed lines, corner treatments, or other modifications.

Parameters

pathEffect
IPathEffect* — Required The IPathEffect object to be set.

setMaskFilter()

void setMaskFilter(IMaskFilter* maskFilter)
This method configures the IMaskFilter to be used by the IPaint.

Parameters

maskFilter
IMaskFilter* — Required The IMaskFilter object to be set.

setBlendMode()

void setBlendMode(BlendMode blendMode)
This method sets the blend mode for the IPaint. The blend mode determines how the paint Color is blended with the colors already present in the canvas during rendering.

Parameters

blendMode
BlendMode — Required The blend mode to set, specified by the BlendMode enum. BlendMode

setStrokeWidth()

void setStrokeWidth(float strokeWidth)
This method sets the width of the stroke when drawing lines or paths for the IPaint. The stroke width determines the thickness of the lines or paths.

Parameters

strokeWidth
float — Required The width of the stroke to set, specified as a floating-point value.
Last modified on October 29, 2026