diff --git a/en/application-dev/reference/arkui-ts/figures/progressMask.PNG b/en/application-dev/reference/arkui-ts/figures/progressMask.PNG new file mode 100644 index 0000000000000000000000000000000000000000..fac3dda28c11979572ff69ed3005be5d40e62b3b Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/progressMask.PNG differ diff --git a/en/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md b/en/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md index a62a7a53b11336ce58448233fe4b1765580b9265..e154c2dfe63000e75d2525a02237a4852e1b5d54 100644 --- a/en/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md +++ b/en/application-dev/reference/arkui-ts/ts-universal-attributes-sharp-clipping.md @@ -13,11 +13,56 @@ Shape clipping changes the visible portion of a component through clipping or ma | Name | Type | Description | | -----| ------------------------------------------ | ------------------------------------ | | clip | [Circle](ts-drawing-components-circle.md) \| [Ellipse](ts-drawing-components-ellipse.md) \| [Path](ts-drawing-components-path.md) \| [Rect](ts-drawing-components-rect.md) \| boolean | Clip mode. If the value is a shape, the component is clipped based on the specified shape. If the value is of the Boolean type, it specifies whether to clip the component based on the edge outline of the parent container.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.| -| mask | [Circle](ts-drawing-components-circle.md) \| [Ellipse](ts-drawing-components-ellipse.md) \| [Path](ts-drawing-components-path.md) \| [Rect](ts-drawing-components-rect.md) | Mask of the specified shape to add to the component.
Since API version 9, this API is supported in ArkTS widgets.| +| mask | [Circle](ts-drawing-components-circle.md) \| [Ellipse](ts-drawing-components-ellipse.md) \| [Path](ts-drawing-components-path.md) \| [Rect](ts-drawing-components-rect.md)\| [ProgressMask](##progressmask10) | Mask of the specified shape to add to the component.
Since API version 9, this API is supported in ArkTS widgets.
Since API version 10, this API supports the **ProgressMask** parameter.| + +## ProgressMask10+ + +Implements a **ProgressMask** object to set the progress, maximum value, and color of the mask. + +### constructor10+ + +constructor(value: number, total: number, color: ResourceColor) + +Constructs a **ProgressMask** object. + +**Parameters** + +| Name| Type | Mandatory| Description | +| ------ | ------------------------------------------ | ---- | ------------------ | +| value | number | Yes | Current value of the progress mask.| +| total | number | Yes | Maximum value of the progress mask.| +| color | [ResourceColor](ts-types.md#resourcecolor) | Yes | Color of the progress mask. | + +### updateProgress10+ + +updateProgress(value: number): void + +Updates the progress value of the progress mask. + +**Parameters** + +| Name| Type| Mandatory| Description | +| ------ | -------- | ---- | ------------------ | +| value | number | Yes | Current value of the progress mask.| + +### updateColor10+ + +updateColor(value: ResourceColor): void + +Updates the color of the progress mask. + +**Parameters** + +| Name| Type | Mandatory| Description | +| ------ | ------------------------------------------ | ---- | ---------------- | +| value | [ResourceColor](ts-types.md#resourcecolor) | Yes | Color of the progress mask.| + ## Example +### Example 1 + ```ts // xxx.ets @Entry @@ -54,3 +99,61 @@ struct ClipAndMaskExample { ``` ![clipAndMask](figures/clipAndMask.PNG) + +### Example 2 + +```ts +@Entry +@Component +struct ProgressMask { + @State progressflag1: boolean = true; + @State color: Color = 0x01006CDE; + @State value: number = 10.0; + @State progress: ProgressMask = new ProgressMask(10.0, 100.0, Color.Gray); + build() { + Column({ space: 15 }) { + Text('progress mask').fontSize(12).width('75%').fontColor('#DCDCDC') + // Add a 280px x 280px progress mask to the image. + Image($r('app.media.testImg')) + .width('500px').height('280px') + .mask(this.progress) + .animation({ + duration: 2000, // Animation duration. + .curve(Curve.Linear) // Animation curve. + delay: 0, // Animation delay. + iterations: 1, // Number of playback times. + playMode: PlayMode.Normal // Animation playback mode. + }) // Animation configuration for the width and height attributes of the