1e41f4b71Sopenharmony_ci# Border Image 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciYou can draw an image around a component. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> The APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## borderImage 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ciborderImage(value: BorderImageOption) 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ciSets the border image of the component. 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci**System capability**: SystemCapability.ArkUI.ArkUI.Full 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci**Parameters** 22e41f4b71Sopenharmony_ci 23e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 24e41f4b71Sopenharmony_ci| ----------- | ----------------------------------------------- | ---- | -------------------------------- | 25e41f4b71Sopenharmony_ci| value | [BorderImageOption](#borderimageoption) | Yes | Border image or border gradient.| 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci## BorderImageOption 28e41f4b71Sopenharmony_ci 29e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets. 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 32e41f4b71Sopenharmony_ci| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 33e41f4b71Sopenharmony_ci| source | string \| [Resource](ts-types.md#resource) \| [linearGradient](ts-universal-attributes-gradient-color.md) | No| Source or gradient color of the border image.<br>**NOTE**<br>The border image source applies only to container components, such as [\<Row>](ts-container-row.md), [\<Column>](ts-container-column.md), and [\<Flex>](ts-container-flex.md).<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 34e41f4b71Sopenharmony_ci| slice | [Length](ts-types.md#length) \| [EdgeWidths](ts-types.md#edgewidths9) \| [LocalizedEdgeWidths](ts-types.md#localizededgewidths12)<sup>12+</sup>| No| Slice width of the upper left corner, upper right corner, lower left corner, and lower right corner of the border image.<br>Default value: **0**<br>**NOTE**<br>If this parameter is set to a negative value, the default value is used.<br>When this parameter is set to a value of the [Length](ts-types.md#length) type, the value applies to the four corners in a unified manner.<br>When this parameter is set to a value of the [EdgeWidths](ts-types.md#edgewidths9) type:<br>- **Top**: slice height of the upper left or upper right corner of the image.<br>- **Bottom**: slice height of the lower left or lower right corner of the image.<br>- **Left**: slice width of the upper left or lower left corner of the image.<br>- **Right**: slice width of the upper right or lower right corner of the image.<br>When the parameter type is [LocalizedEdgeWidths](ts-types.md#localizededgewidths12)<sup>12+</sup>:<br>- **Top**: slice height of the upper left or upper right corner of the image.<br>- **Bottom**: slice height of the lower left or lower right corner of the image.<br>- **Start**: slice width of the upper left or lower left corner of the image for left-to-right scripts;<br>slice width of the upper right or lower right corner of the image for right-to-left scripts.<br>- **End**: slice width of the upper right or lower right corner of the image for left-to-right scripts; slice width of the upper left or lower left corner of the image for right-to-left scripts.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 35e41f4b71Sopenharmony_ci| width | [Length](ts-types.md#length) \| [EdgeWidths](ts-types.md#edgewidths9) \| [LocalizedEdgeWidths](ts-types.md#localizededgewidths12)<sup>12+</sup> | No| Width of the border image.<br>Default value: **0**<br>**NOTE**<br>If this parameter is set to a negative value, the default value is used.<br>When this parameter is set to a value of the [Length](ts-types.md#length) type, the value applies to the four corners in a unified manner.<br>When this parameter is set to a value of the [EdgeWidths](ts-types.md#edgewidths9) type:<br>- **Top**: width of the top edge of the border image.<br>- **Bottom**: width of the bottom edge of the border image.<br>- **Left**: width of the left edge of the border image.<br>- **Right**: width of the right edge of the border image.<br>When the parameter type is [LocalizedEdgeWidths](ts-types.md#localizededgewidths12)<sup>12+</sup>:<br>- **Top**: width of the top edge of the border image.<br>- **Bottom**: width of the bottom edge of the border image.<br>- **Start**: width of the left edge of the border image for left-to-right scripts;<br>width of the right edge of the border image for right-to-left scripts.<br>- **End**: width of the right edge of the border image for left-to-right scripts;<br>width of the left edge of the border image for right-to-left scripts.<br>If this parameter is set to a negative value, the value **1** is used.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 36e41f4b71Sopenharmony_ci| outset | [Length](ts-types.md#length) \| [EdgeWidths](ts-types.md#edgewidths9) \| [LocalizedEdgeWidths](ts-types.md#localizededgewidths12)<sup>12+</sup> | No| Amount by which the border image is extended beyond the border box.<br>Default value: **0**<br>**NOTE**<br>If this parameter is set to a negative value, the default value is used.<br>When this parameter is set to a value of the [Length](ts-types.md#length) type, the value applies to the four corners in a unified manner.<br>When this parameter is set to a value of the [EdgeWidths](ts-types.md#edgewidths9) type:<br>- **Top**: amount by which the top edge of the border image is extended beyond the border box.<br>- **Bottom**: amount by which the bottom edge of the border image is extended beyond the border box.<br>- **Left**: amount by which the left edge of the border image is extended beyond the border box.<br>- **Right**: amount by which the right edge of the border image is extended beyond the border box.<br>When the parameter type is [LocalizedEdgeWidths](ts-types.md#localizededgewidths12)<sup>12+</sup>:<br>- **Top**: amount by which the top edge of the border image is extended beyond the border box.<br>- **Bottom**: amount by which the bottom edge of the border image is extended beyond the border box.<br>- **Start**: amount by which the left edge of the border image is extended beyond the border box for left-to-right scripts;<br>amount by which the right edge of the border image is extended beyond the border box for right-to-left scripts.<br>- **End**: amount by which the right edge of the border image is extended beyond the border box for left-to-right scripts;<br>amount by which the left edge of the border image is extended beyond the border box for right-to-left scripts.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 37e41f4b71Sopenharmony_ci| repeat | [RepeatMode](#repeatmode) | No| Repeat mode of the source image's slices on the border.<br>Default value: **RepeatMode.Stretch**<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 38e41f4b71Sopenharmony_ci| fill | boolean | No| Whether to fill the center of the border image.<br>Default value: **false**<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 39e41f4b71Sopenharmony_ci 40e41f4b71Sopenharmony_ci## RepeatMode 41e41f4b71Sopenharmony_ci 42e41f4b71Sopenharmony_ci**Widget capability**: Since API version 9, this feature is supported in ArkTS widgets. 43e41f4b71Sopenharmony_ci 44e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 45e41f4b71Sopenharmony_ci 46e41f4b71Sopenharmony_ci| Name | Description | 47e41f4b71Sopenharmony_ci| ------- | ----------------------------------- | 48e41f4b71Sopenharmony_ci| Repeat | The source image's slices are tiled. Tiles beyond the border box will be clipped. | 49e41f4b71Sopenharmony_ci| Stretch | The source image's slices are stretched to fill the border box. | 50e41f4b71Sopenharmony_ci| Round | The source image's slices are tiled to fill the border box. Tiles may be compressed when needed.| 51e41f4b71Sopenharmony_ci| Space | The source image's slices are tiled to fill the border box. Extra space will be distributed in between tiles. | 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci## Example 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci### Example 1 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_ci```ts 59e41f4b71Sopenharmony_ci// xxx.ets 60e41f4b71Sopenharmony_ci@Entry 61e41f4b71Sopenharmony_ci@Component 62e41f4b71Sopenharmony_cistruct Index { 63e41f4b71Sopenharmony_ci build() { 64e41f4b71Sopenharmony_ci Row() { 65e41f4b71Sopenharmony_ci Column() { 66e41f4b71Sopenharmony_ci Text('This is gradient color.').textAlign(TextAlign.Center).height(50).width(200) 67e41f4b71Sopenharmony_ci .borderImage({ 68e41f4b71Sopenharmony_ci source: { 69e41f4b71Sopenharmony_ci angle: 90, 70e41f4b71Sopenharmony_ci direction: GradientDirection.Left, 71e41f4b71Sopenharmony_ci colors: [[0xAEE1E1, 0.0], [0xD3E0DC, 0.3], [0xFCD1D1, 1.0]] 72e41f4b71Sopenharmony_ci }, 73e41f4b71Sopenharmony_ci slice: { top: 10, bottom: 10, left: 10, right: 10 }, 74e41f4b71Sopenharmony_ci width: { top: "10px", bottom: "10px", left: "10px", right: "10px" }, 75e41f4b71Sopenharmony_ci repeat: RepeatMode.Stretch, 76e41f4b71Sopenharmony_ci fill: false 77e41f4b71Sopenharmony_ci }) 78e41f4b71Sopenharmony_ci } 79e41f4b71Sopenharmony_ci .width('100%') 80e41f4b71Sopenharmony_ci } 81e41f4b71Sopenharmony_ci .height('100%') 82e41f4b71Sopenharmony_ci } 83e41f4b71Sopenharmony_ci} 84e41f4b71Sopenharmony_ci``` 85e41f4b71Sopenharmony_ci 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci 88e41f4b71Sopenharmony_ci### Example 2 89e41f4b71Sopenharmony_ci 90e41f4b71Sopenharmony_ci```ts 91e41f4b71Sopenharmony_ci// xxx.ets 92e41f4b71Sopenharmony_ci@Entry 93e41f4b71Sopenharmony_ci@Component 94e41f4b71Sopenharmony_cistruct BorderImage { 95e41f4b71Sopenharmony_ci @State WidthValue: number = 0 96e41f4b71Sopenharmony_ci @State SliceValue: number = 0 97e41f4b71Sopenharmony_ci @State OutSetValue: number = 0 98e41f4b71Sopenharmony_ci @State RepeatValue: RepeatMode[] = [RepeatMode.Repeat, RepeatMode.Stretch, RepeatMode.Round, RepeatMode.Space] 99e41f4b71Sopenharmony_ci @State SelectIndex: number = 0 100e41f4b71Sopenharmony_ci @State SelectText: string = 'Repeat' 101e41f4b71Sopenharmony_ci @State FillValue: boolean = false 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ci build() { 104e41f4b71Sopenharmony_ci Row() { 105e41f4b71Sopenharmony_ci Column({ space: 20 }) { 106e41f4b71Sopenharmony_ci Row() { 107e41f4b71Sopenharmony_ci Text('This is borderImage.').textAlign(TextAlign.Center).fontSize(50) 108e41f4b71Sopenharmony_ci } 109e41f4b71Sopenharmony_ci .borderImage({ 110e41f4b71Sopenharmony_ci source: $r('app.media.icon'), 111e41f4b71Sopenharmony_ci slice: this.SliceValue, 112e41f4b71Sopenharmony_ci width: this.WidthValue, 113e41f4b71Sopenharmony_ci outset: this.OutSetValue, 114e41f4b71Sopenharmony_ci repeat: this.RepeatValue[this.SelectIndex], 115e41f4b71Sopenharmony_ci fill: this.FillValue 116e41f4b71Sopenharmony_ci }) 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci Column() { 119e41f4b71Sopenharmony_ci Text(`borderImageSlice = ${this.SliceValue}px`) 120e41f4b71Sopenharmony_ci Slider({ 121e41f4b71Sopenharmony_ci value: this.SliceValue, 122e41f4b71Sopenharmony_ci min: 0, 123e41f4b71Sopenharmony_ci max: 100, 124e41f4b71Sopenharmony_ci style: SliderStyle.OutSet 125e41f4b71Sopenharmony_ci }) 126e41f4b71Sopenharmony_ci .onChange((value: number, mode: SliderChangeMode) => { 127e41f4b71Sopenharmony_ci this.SliceValue = value 128e41f4b71Sopenharmony_ci }) 129e41f4b71Sopenharmony_ci } 130e41f4b71Sopenharmony_ci 131e41f4b71Sopenharmony_ci Column() { 132e41f4b71Sopenharmony_ci Text(`borderImageWidth = ${this.WidthValue}px`) 133e41f4b71Sopenharmony_ci Slider({ 134e41f4b71Sopenharmony_ci value: this.WidthValue, 135e41f4b71Sopenharmony_ci min: 0, 136e41f4b71Sopenharmony_ci max: 100, 137e41f4b71Sopenharmony_ci style: SliderStyle.OutSet 138e41f4b71Sopenharmony_ci }) 139e41f4b71Sopenharmony_ci .onChange((value: number, mode: SliderChangeMode) => { 140e41f4b71Sopenharmony_ci this.WidthValue = value 141e41f4b71Sopenharmony_ci }) 142e41f4b71Sopenharmony_ci } 143e41f4b71Sopenharmony_ci 144e41f4b71Sopenharmony_ci Column() { 145e41f4b71Sopenharmony_ci Text(`borderImageOutSet = ${this.OutSetValue}px`) 146e41f4b71Sopenharmony_ci Slider({ 147e41f4b71Sopenharmony_ci value: this.OutSetValue, 148e41f4b71Sopenharmony_ci min: 0, 149e41f4b71Sopenharmony_ci max: 100, 150e41f4b71Sopenharmony_ci style: SliderStyle.OutSet 151e41f4b71Sopenharmony_ci }) 152e41f4b71Sopenharmony_ci .onChange((value: number, mode: SliderChangeMode) => { 153e41f4b71Sopenharmony_ci this.OutSetValue = value 154e41f4b71Sopenharmony_ci }) 155e41f4b71Sopenharmony_ci } 156e41f4b71Sopenharmony_ci 157e41f4b71Sopenharmony_ci Row() { 158e41f4b71Sopenharmony_ci Text('borderImageRepeat: ') 159e41f4b71Sopenharmony_ci Select([{ value: 'Repeat' }, { value: 'Stretch' }, { value: 'Round' }, { value: 'Space' }]) 160e41f4b71Sopenharmony_ci .value(this.SelectText) 161e41f4b71Sopenharmony_ci .selected(this.SelectIndex) 162e41f4b71Sopenharmony_ci .onSelect((index: number, value?: string) => { 163e41f4b71Sopenharmony_ci this.SelectIndex = index 164e41f4b71Sopenharmony_ci this.SelectText = value as string 165e41f4b71Sopenharmony_ci }) 166e41f4b71Sopenharmony_ci } 167e41f4b71Sopenharmony_ci 168e41f4b71Sopenharmony_ci Row() { 169e41f4b71Sopenharmony_ci Text(`borderImageFill: ${this.FillValue} `) 170e41f4b71Sopenharmony_ci Toggle({ type: ToggleType.Switch, isOn: this.FillValue }) 171e41f4b71Sopenharmony_ci .onChange((isOn: boolean) => { 172e41f4b71Sopenharmony_ci this.FillValue = isOn 173e41f4b71Sopenharmony_ci }) 174e41f4b71Sopenharmony_ci } 175e41f4b71Sopenharmony_ci 176e41f4b71Sopenharmony_ci } 177e41f4b71Sopenharmony_ci .width('100%') 178e41f4b71Sopenharmony_ci } 179e41f4b71Sopenharmony_ci .height('100%') 180e41f4b71Sopenharmony_ci } 181e41f4b71Sopenharmony_ci} 182e41f4b71Sopenharmony_ci``` 183e41f4b71Sopenharmony_ci 184e41f4b71Sopenharmony_ci 185e41f4b71Sopenharmony_ci 186e41f4b71Sopenharmony_ci### Example 3 187e41f4b71Sopenharmony_ci 188e41f4b71Sopenharmony_ci```ts 189e41f4b71Sopenharmony_ci// xxx.ets 190e41f4b71Sopenharmony_ci// The slice, width, and outset attributes of borderImage use the LocalizedEdgeWidths type. 191e41f4b71Sopenharmony_ci 192e41f4b71Sopenharmony_ciimport { LengthMetrics } from '@kit.ArkUI' 193e41f4b71Sopenharmony_ci 194e41f4b71Sopenharmony_ci@Entry 195e41f4b71Sopenharmony_ci@Component 196e41f4b71Sopenharmony_cistruct BorderImage { 197e41f4b71Sopenharmony_ci @State WidthStartValue: number = 0 198e41f4b71Sopenharmony_ci @State WidthEndValue: number = 0 199e41f4b71Sopenharmony_ci @State SliceStartValue: number = 0 200e41f4b71Sopenharmony_ci @State SliceEndValue: number = 0 201e41f4b71Sopenharmony_ci @State OutSetStartValue: number = 0 202e41f4b71Sopenharmony_ci @State OutSetEndValue: number = 0 203e41f4b71Sopenharmony_ci @State RepeatValue: RepeatMode[] = [RepeatMode.Repeat, RepeatMode.Stretch, RepeatMode.Round, RepeatMode.Space] 204e41f4b71Sopenharmony_ci @State SelectIndex: number = 0 205e41f4b71Sopenharmony_ci @State SelectText: string = 'Repeat' 206e41f4b71Sopenharmony_ci @State FillValue: boolean = false 207e41f4b71Sopenharmony_ci 208e41f4b71Sopenharmony_ci build() { 209e41f4b71Sopenharmony_ci Row() { 210e41f4b71Sopenharmony_ci Column({ space: 20 }) { 211e41f4b71Sopenharmony_ci Row() { 212e41f4b71Sopenharmony_ci Text('This is borderImage.').textAlign(TextAlign.Center).fontSize(50) 213e41f4b71Sopenharmony_ci } 214e41f4b71Sopenharmony_ci .borderImage({ 215e41f4b71Sopenharmony_ci source: $r('app.media.icon'), 216e41f4b71Sopenharmony_ci slice: { 217e41f4b71Sopenharmony_ci top: LengthMetrics.px(10), 218e41f4b71Sopenharmony_ci bottom: LengthMetrics.px(10), 219e41f4b71Sopenharmony_ci start: LengthMetrics.px(this.SliceStartValue), 220e41f4b71Sopenharmony_ci end: LengthMetrics.px(this.SliceEndValue) }, 221e41f4b71Sopenharmony_ci width: { 222e41f4b71Sopenharmony_ci top: LengthMetrics.px(10), 223e41f4b71Sopenharmony_ci bottom: LengthMetrics.px(10), 224e41f4b71Sopenharmony_ci start: LengthMetrics.px(this.WidthStartValue), 225e41f4b71Sopenharmony_ci end: LengthMetrics.px(this.WidthEndValue) 226e41f4b71Sopenharmony_ci }, 227e41f4b71Sopenharmony_ci outset: { 228e41f4b71Sopenharmony_ci top: LengthMetrics.px(10), 229e41f4b71Sopenharmony_ci bottom: LengthMetrics.px(10), 230e41f4b71Sopenharmony_ci start: LengthMetrics.px(this.OutSetStartValue), 231e41f4b71Sopenharmony_ci end: LengthMetrics.px(this.OutSetEndValue) 232e41f4b71Sopenharmony_ci }, 233e41f4b71Sopenharmony_ci repeat: this.RepeatValue[this.SelectIndex], 234e41f4b71Sopenharmony_ci fill: this.FillValue 235e41f4b71Sopenharmony_ci }) 236e41f4b71Sopenharmony_ci 237e41f4b71Sopenharmony_ci Column() { 238e41f4b71Sopenharmony_ci Text(`borderImageSliceStart = ${this.SliceStartValue}px`) 239e41f4b71Sopenharmony_ci Slider({ 240e41f4b71Sopenharmony_ci value: this.SliceStartValue, 241e41f4b71Sopenharmony_ci min: 0, 242e41f4b71Sopenharmony_ci max: 100, 243e41f4b71Sopenharmony_ci style: SliderStyle.OutSet 244e41f4b71Sopenharmony_ci }) 245e41f4b71Sopenharmony_ci .onChange((value: number, mode: SliderChangeMode) => { 246e41f4b71Sopenharmony_ci this.SliceStartValue = value 247e41f4b71Sopenharmony_ci }) 248e41f4b71Sopenharmony_ci } 249e41f4b71Sopenharmony_ci 250e41f4b71Sopenharmony_ci Column() { 251e41f4b71Sopenharmony_ci Text(`borderImageEndSliceStart = ${this.SliceEndValue}px`) 252e41f4b71Sopenharmony_ci Slider({ 253e41f4b71Sopenharmony_ci value: this.SliceEndValue, 254e41f4b71Sopenharmony_ci min: 0, 255e41f4b71Sopenharmony_ci max: 100, 256e41f4b71Sopenharmony_ci style: SliderStyle.OutSet 257e41f4b71Sopenharmony_ci }) 258e41f4b71Sopenharmony_ci .onChange((value: number, mode: SliderChangeMode) => { 259e41f4b71Sopenharmony_ci this.SliceEndValue = value 260e41f4b71Sopenharmony_ci }) 261e41f4b71Sopenharmony_ci } 262e41f4b71Sopenharmony_ci 263e41f4b71Sopenharmony_ci Column() { 264e41f4b71Sopenharmony_ci Text(`borderImageWidthStart = ${this.WidthStartValue}px`) 265e41f4b71Sopenharmony_ci Slider({ 266e41f4b71Sopenharmony_ci value: this.WidthStartValue, 267e41f4b71Sopenharmony_ci min: 0, 268e41f4b71Sopenharmony_ci max: 100, 269e41f4b71Sopenharmony_ci style: SliderStyle.OutSet 270e41f4b71Sopenharmony_ci }) 271e41f4b71Sopenharmony_ci .onChange((value: number, mode: SliderChangeMode) => { 272e41f4b71Sopenharmony_ci this.WidthStartValue = value 273e41f4b71Sopenharmony_ci }) 274e41f4b71Sopenharmony_ci } 275e41f4b71Sopenharmony_ci 276e41f4b71Sopenharmony_ci Column() { 277e41f4b71Sopenharmony_ci Text(`borderImageWidthEnd = ${this.WidthEndValue}px`) 278e41f4b71Sopenharmony_ci Slider({ 279e41f4b71Sopenharmony_ci value: this.WidthEndValue, 280e41f4b71Sopenharmony_ci min: 0, 281e41f4b71Sopenharmony_ci max: 100, 282e41f4b71Sopenharmony_ci style: SliderStyle.OutSet 283e41f4b71Sopenharmony_ci }) 284e41f4b71Sopenharmony_ci .onChange((value: number, mode: SliderChangeMode) => { 285e41f4b71Sopenharmony_ci this.WidthEndValue = value 286e41f4b71Sopenharmony_ci }) 287e41f4b71Sopenharmony_ci } 288e41f4b71Sopenharmony_ci 289e41f4b71Sopenharmony_ci Column() { 290e41f4b71Sopenharmony_ci Text(`borderImageOutSetStart = ${this.OutSetStartValue}px`) 291e41f4b71Sopenharmony_ci Slider({ 292e41f4b71Sopenharmony_ci value: this.OutSetStartValue, 293e41f4b71Sopenharmony_ci min: 0, 294e41f4b71Sopenharmony_ci max: 100, 295e41f4b71Sopenharmony_ci style: SliderStyle.OutSet 296e41f4b71Sopenharmony_ci }) 297e41f4b71Sopenharmony_ci .onChange((value: number, mode: SliderChangeMode) => { 298e41f4b71Sopenharmony_ci this.OutSetStartValue = value 299e41f4b71Sopenharmony_ci }) 300e41f4b71Sopenharmony_ci } 301e41f4b71Sopenharmony_ci 302e41f4b71Sopenharmony_ci Column() { 303e41f4b71Sopenharmony_ci Text(`borderImageOutSetEnd = ${this.OutSetEndValue}px`) 304e41f4b71Sopenharmony_ci Slider({ 305e41f4b71Sopenharmony_ci value: this.OutSetEndValue, 306e41f4b71Sopenharmony_ci min: 0, 307e41f4b71Sopenharmony_ci max: 100, 308e41f4b71Sopenharmony_ci style: SliderStyle.OutSet 309e41f4b71Sopenharmony_ci }) 310e41f4b71Sopenharmony_ci .onChange((value: number, mode: SliderChangeMode) => { 311e41f4b71Sopenharmony_ci this.OutSetEndValue = value 312e41f4b71Sopenharmony_ci }) 313e41f4b71Sopenharmony_ci } 314e41f4b71Sopenharmony_ci 315e41f4b71Sopenharmony_ci Row() { 316e41f4b71Sopenharmony_ci Text('borderImageRepeat: ') 317e41f4b71Sopenharmony_ci Select([{ value: 'Repeat' }, { value: 'Stretch' }, { value: 'Round' }, { value: 'Space' }]) 318e41f4b71Sopenharmony_ci .value(this.SelectText) 319e41f4b71Sopenharmony_ci .selected(this.SelectIndex) 320e41f4b71Sopenharmony_ci .onSelect((index: number, value?: string) => { 321e41f4b71Sopenharmony_ci this.SelectIndex = index 322e41f4b71Sopenharmony_ci this.SelectText = value as string 323e41f4b71Sopenharmony_ci }) 324e41f4b71Sopenharmony_ci } 325e41f4b71Sopenharmony_ci 326e41f4b71Sopenharmony_ci Row() { 327e41f4b71Sopenharmony_ci Text(`borderImageFill: ${this.FillValue} `) 328e41f4b71Sopenharmony_ci Toggle({ type: ToggleType.Switch, isOn: this.FillValue }) 329e41f4b71Sopenharmony_ci .onChange((isOn: boolean) => { 330e41f4b71Sopenharmony_ci this.FillValue = isOn 331e41f4b71Sopenharmony_ci }) 332e41f4b71Sopenharmony_ci } 333e41f4b71Sopenharmony_ci 334e41f4b71Sopenharmony_ci } 335e41f4b71Sopenharmony_ci .width('100%') 336e41f4b71Sopenharmony_ci } 337e41f4b71Sopenharmony_ci .height('100%') 338e41f4b71Sopenharmony_ci } 339e41f4b71Sopenharmony_ci} 340e41f4b71Sopenharmony_ci``` 341e41f4b71Sopenharmony_ci 342e41f4b71Sopenharmony_ciThe following shows how the example is represented with left-to-right scripts. 343e41f4b71Sopenharmony_ci 344e41f4b71Sopenharmony_ci 345e41f4b71Sopenharmony_ci 346e41f4b71Sopenharmony_ciThe following shows how the example is represented with right-to-left scripts. 347e41f4b71Sopenharmony_ci 348e41f4b71Sopenharmony_ci 349