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()
This method returns theIShader?getShader()
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()
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.IMaskFilter?getMaskFilter()
Returns
IMaskFilter?
The return value is optional and might be absent.
The IMaskFilter instance associated with this IPaint object.
getPathEffect()
This method returns theIPathEffect?getPathEffect()
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()
This method returns theIColorFilter?getColorFilter()
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()
This method sets the painting style for the IPaint.voidsetStyle(PaintStylestyle)
Parameters
style
PaintStyle — Required
PaintStyle object representing the desired styling. PaintStyle
setAlpha()
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.voidsetAlpha(floatalpha)
Parameters
alpha
float — Required
The alpha value to set, specified as a float.
setAntiAlias()
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.voidsetAntiAlias(boolantiAlias)
Parameters
antiAlias
bool — Required
A boolean value to enable or disable anti-aliasing.
setColor()
This method sets thevoidsetColor(Color*color)
Color for the IPaint.
Parameters
color
Color* — Required
The Color to set, specified as a Color object.
setShader()
This method sets thevoidsetShader(IShader*shader)
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()
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.voidsetStrokeCap(StrokeCapcap)
Parameters
cap
StrokeCap — Required
The stroke end cap style to set, defined by the StrokeCap enum. StrokeCap
setStrokeJoin()
This method sets the style of the joins between connected segments of avoidsetStrokeJoin(StrokeJoinjoin)
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()
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.voidsetStrokeMiter(floatmiter)
Parameters
miter
float — Required
The miter limit to set, specified as a floating-point value.
setColorFilter()
This method sets thevoidsetColorFilter(IColorFilter*colorFilter)
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()
This method sets thevoidsetPathEffect(IPathEffect*pathEffect)
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()
This method configures thevoidsetMaskFilter(IMaskFilter*maskFilter)
IMaskFilter to be used by the IPaint.
Parameters
maskFilter
IMaskFilter* — Required
The IMaskFilter object to be set.
setBlendMode()
This method sets the blend mode for the IPaint. The blend mode determines how the paintvoidsetBlendMode(BlendModeblendMode)
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()
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.voidsetStrokeWidth(floatstrokeWidth)
Parameters
strokeWidth
float — Required
The width of the stroke to set, specified as a floating-point value.

