智能客服
你问我答,随时在线为你解决问题

























| |---ohos.agp.components.element.Element |---|---ohos.agp.components.element.VectorElement public class VectorElement extends Element |
You can use this class to draw vector elements to prevent image distortion after scaling.
Since:
3Nested classes/interfaces inherited from class ohos.agp.components.element.Element |
|---|
Element.ConstantState, Element.OnBoundsChangeListener, Element.OnChangeListener, Element.OnLayoutDirectionChangeListener, Element.OnRankChangeListener |
Fields inherited from class ohos.agp.components.element.Element |
|---|
ALPHA_DEFAULT, ALPHA_MAX, ALPHA_MIN, DEFAULT_BOUNDS_RECT, MAX_RANK, MIN_RANK |
Constructor | Description |
|---|---|
VectorElement(Context context, int xmlId) | A constructor used to create a VectorElement instance based on the specified XML resource. |
Modifier and Type | Method | Description |
|---|---|---|
boolean | isAntiAlias() | Checks whether Anti-Aliasing is enabled. |
void | setAntiAlias(boolean isAntiAlias) | Sets the anti-aliasing function. |
Methods inherited from class ohos.agp.components.element.Element |
|---|
clearColorMatrix, drawToCanvas, getAlpha, getBounds, getCallback, getColorMatrix, getCurrentElement, getHeight, getLayoutDirection, getMinHeight, getMinWidth, getPadding, getRank, getStateColorMode, getVisible, getWidth, isInheritDirection, isStateful, isVisible, release, setAlpha, setBounds, setBounds, setCallback, setColorMatrix, setInheritDirection, setLayoutDirection, setOnBoundsChangeListener, setOnLayoutDirectionChangeListener, setOnRankChangeListener, setRank, setStateColor, setStateColorList, setStateColorMode, setVisible, skipAnimation |
public VectorElement(Context context, int xmlId)
A constructor used to create a VectorElement instance based on the specified XML resource.Parameters:
Parameter Name | Parameter Description |
|---|---|
context | Indicates the application context. |
xmlId | Indicates the ID of the XML resource. |
Since:
3
public void setAntiAlias(boolean isAntiAlias)
Sets the anti-aliasing function.Note: be careful with the changing this property because it will affect all instances of an element loaded from the same resource.
Parameters:
Parameter Name | Parameter Description |
|---|---|
isAntiAlias | Indicates whether the Anti-Aliasing function is enabled. true indicates enabled. |
Since:
3
public boolean isAntiAlias()
Checks whether Anti-Aliasing is enabled.Returns:
Returns true if antialiasing is enabled; returns false otherwise.
Since:
4
智能客服
你问我答,随时在线为你解决问题
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功