1/* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * Use the DrawableDescriptor class to get drawable image. 18 * 19 * @syscap SystemCapability.ArkUI.ArkUI.Full 20 * @since 10 21 */ 22/** 23 * Use the DrawableDescriptor class to get drawable image. 24 * 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @atomicservice 27 * @since 11 28 */ 29declare type DrawableDescriptor = import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor; 30 31/** 32 * @enum { number } 33 * @syscap SystemCapability.ArkUI.ArkUI.Full 34 * @since 7 35 */ 36/** 37 * @enum { number } 38 * @syscap SystemCapability.ArkUI.ArkUI.Full 39 * @since 9 40 * @form 41 */ 42/** 43 * @enum { number } 44 * @syscap SystemCapability.ArkUI.ArkUI.Full 45 * @crossplatform 46 * @since 10 47 * @form 48 */ 49/** 50 * @enum { number } 51 * @syscap SystemCapability.ArkUI.ArkUI.Full 52 * @crossplatform 53 * @atomicservice 54 * @since 11 55 * @form 56 */ 57declare enum ImageRenderMode { 58 /** 59 * Render according to the original image, including colors. 60 * 61 * @syscap SystemCapability.ArkUI.ArkUI.Full 62 * @since 7 63 */ 64 /** 65 * Render according to the original image, including colors. 66 * 67 * @syscap SystemCapability.ArkUI.ArkUI.Full 68 * @since 9 69 * @form 70 */ 71 /** 72 * Render according to the original image, including colors. 73 * 74 * @syscap SystemCapability.ArkUI.ArkUI.Full 75 * @crossplatform 76 * @since 10 77 * @form 78 */ 79 /** 80 * Render according to the original image, including colors. 81 * 82 * @syscap SystemCapability.ArkUI.ArkUI.Full 83 * @crossplatform 84 * @atomicservice 85 * @since 11 86 * @form 87 */ 88 Original, 89 90 /** 91 * Render the image as a template image, ignoring the color information of the image. 92 * 93 * @syscap SystemCapability.ArkUI.ArkUI.Full 94 * @since 7 95 */ 96 /** 97 * Render the image as a template image, ignoring the color information of the image. 98 * 99 * @syscap SystemCapability.ArkUI.ArkUI.Full 100 * @since 9 101 * @form 102 */ 103 /** 104 * Render the image as a template image, ignoring the color information of the image. 105 * 106 * @syscap SystemCapability.ArkUI.ArkUI.Full 107 * @crossplatform 108 * @since 10 109 * @form 110 */ 111 /** 112 * Render the image as a template image, ignoring the color information of the image. 113 * 114 * @syscap SystemCapability.ArkUI.ArkUI.Full 115 * @crossplatform 116 * @atomicservice 117 * @since 11 118 * @form 119 */ 120 Template, 121} 122 123/** 124 * @enum { number } 125 * @syscap SystemCapability.ArkUI.ArkUI.Full 126 * @since 7 127 */ 128/** 129 * @enum { number } 130 * @syscap SystemCapability.ArkUI.ArkUI.Full 131 * @since 9 132 * @form 133 */ 134/** 135 * @enum { number } 136 * @syscap SystemCapability.ArkUI.ArkUI.Full 137 * @crossplatform 138 * @since 10 139 * @form 140 */ 141/** 142 * @enum { number } 143 * @syscap SystemCapability.ArkUI.ArkUI.Full 144 * @crossplatform 145 * @atomicservice 146 * @since 11 147 * @form 148 */ 149declare enum ImageInterpolation { 150 /** 151 * Do not use interpolated image data. 152 * 153 * @syscap SystemCapability.ArkUI.ArkUI.Full 154 * @since 7 155 */ 156 /** 157 * Do not use interpolated image data. 158 * 159 * @syscap SystemCapability.ArkUI.ArkUI.Full 160 * @since 9 161 * @form 162 */ 163 /** 164 * Do not use interpolated image data. 165 * 166 * @syscap SystemCapability.ArkUI.ArkUI.Full 167 * @crossplatform 168 * @since 10 169 * @form 170 */ 171 /** 172 * Do not use interpolated image data. 173 * 174 * @syscap SystemCapability.ArkUI.ArkUI.Full 175 * @crossplatform 176 * @atomicservice 177 * @since 11 178 * @form 179 */ 180 None, 181 182 /** 183 * Low usage of interpolated image data. 184 * 185 * @syscap SystemCapability.ArkUI.ArkUI.Full 186 * @since 7 187 */ 188 /** 189 * Low usage of interpolated image data. 190 * 191 * @syscap SystemCapability.ArkUI.ArkUI.Full 192 * @since 9 193 * @form 194 */ 195 /** 196 * Low usage of interpolated image data. 197 * 198 * @syscap SystemCapability.ArkUI.ArkUI.Full 199 * @crossplatform 200 * @since 10 201 * @form 202 */ 203 /** 204 * Low usage of interpolated image data. 205 * 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @crossplatform 208 * @atomicservice 209 * @since 11 210 * @form 211 */ 212 Low, 213 214 /** 215 * Interpolated image data is used moderately. 216 * 217 * @syscap SystemCapability.ArkUI.ArkUI.Full 218 * @since 7 219 */ 220 /** 221 * Interpolated image data is used moderately. 222 * 223 * @syscap SystemCapability.ArkUI.ArkUI.Full 224 * @since 9 225 * @form 226 */ 227 /** 228 * Interpolated image data is used moderately. 229 * 230 * @syscap SystemCapability.ArkUI.ArkUI.Full 231 * @crossplatform 232 * @since 10 233 * @form 234 */ 235 /** 236 * Interpolated image data is used moderately. 237 * 238 * @syscap SystemCapability.ArkUI.ArkUI.Full 239 * @crossplatform 240 * @atomicservice 241 * @since 11 242 * @form 243 */ 244 Medium, 245 246 /** 247 * High usage of interpolated image data may affect the speed of image rendering. 248 * 249 * @syscap SystemCapability.ArkUI.ArkUI.Full 250 * @since 7 251 */ 252 /** 253 * High usage of interpolated image data may affect the speed of image rendering. 254 * 255 * @syscap SystemCapability.ArkUI.ArkUI.Full 256 * @since 9 257 * @form 258 */ 259 /** 260 * High usage of interpolated image data may affect the speed of image rendering. 261 * 262 * @syscap SystemCapability.ArkUI.ArkUI.Full 263 * @crossplatform 264 * @since 10 265 * @form 266 */ 267 /** 268 * High usage of interpolated image data may affect the speed of image rendering. 269 * 270 * @syscap SystemCapability.ArkUI.ArkUI.Full 271 * @crossplatform 272 * @atomicservice 273 * @since 11 274 * @form 275 */ 276 High, 277} 278 279/** 280 * @interface ImageInterface 281 * @syscap SystemCapability.ArkUI.ArkUI.Full 282 * @since 7 283 */ 284/** 285 * @interface ImageInterface 286 * @syscap SystemCapability.ArkUI.ArkUI.Full 287 * @since 9 288 * @form 289 */ 290/** 291 * @interface ImageInterface 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @crossplatform 294 * @since 10 295 * @form 296 */ 297/** 298 * @interface ImageInterface 299 * @syscap SystemCapability.ArkUI.ArkUI.Full 300 * @crossplatform 301 * @atomicservice 302 * @since 11 303 * @form 304 */ 305interface ImageInterface { 306 /** 307 * Set src to obtain images. 308 * 309 * @param { PixelMap | ResourceStr | DrawableDescriptor } src 310 * @returns { ImageAttribute } 311 * @syscap SystemCapability.ArkUI.ArkUI.Full 312 * @since 7 313 */ 314 /** 315 * Set src to obtain images 316 * 317 * @param { PixelMap | ResourceStr | DrawableDescriptor } src 318 * @returns { ImageAttribute } 319 * @syscap SystemCapability.ArkUI.ArkUI.Full 320 * @since 9 321 * @form 322 */ 323 /** 324 * Set src to obtain images 325 * 326 * @param { PixelMap | ResourceStr | DrawableDescriptor } src 327 * @returns { ImageAttribute } 328 * @syscap SystemCapability.ArkUI.ArkUI.Full 329 * @crossplatform 330 * @since 10 331 * @form 332 */ 333 /** 334 * Set src to obtain images 335 * 336 * @param { PixelMap | ResourceStr | DrawableDescriptor } src 337 * @returns { ImageAttribute } 338 * @syscap SystemCapability.ArkUI.ArkUI.Full 339 * @crossplatform 340 * @atomicservice 341 * @since 11 342 * @form 343 */ 344 (src: PixelMap | ResourceStr | DrawableDescriptor): ImageAttribute; 345} 346 347/** 348 * @extends CommonMethod<ImageAttribute> 349 * @syscap SystemCapability.ArkUI.ArkUI.Full 350 * @since 7 351 */ 352/** 353 * @extends CommonMethod<ImageAttribute> 354 * @syscap SystemCapability.ArkUI.ArkUI.Full 355 * @since 9 356 * @form 357 */ 358/** 359 * @extends CommonMethod<ImageAttribute> 360 * @syscap SystemCapability.ArkUI.ArkUI.Full 361 * @crossplatform 362 * @since 10 363 * @form 364 */ 365/** 366 * @extends CommonMethod<ImageAttribute> 367 * @syscap SystemCapability.ArkUI.ArkUI.Full 368 * @crossplatform 369 * @atomicservice 370 * @since 11 371 * @form 372 */ 373declare class ImageAttribute extends CommonMethod<ImageAttribute> { 374 /** 375 * Placeholder displayed on load 376 * 377 * @param { string | Resource } value 378 * @returns { ImageAttribute } 379 * @syscap SystemCapability.ArkUI.ArkUI.Full 380 * @since 7 381 */ 382 /** 383 * Placeholder displayed on load 384 * 385 * @param { string | Resource } value 386 * @returns { ImageAttribute } 387 * @syscap SystemCapability.ArkUI.ArkUI.Full 388 * @since 9 389 * @form 390 */ 391 /** 392 * Placeholder displayed on load 393 * 394 * @param { string | Resource } value 395 * @returns { ImageAttribute } 396 * @syscap SystemCapability.ArkUI.ArkUI.Full 397 * @crossplatform 398 * @since 10 399 * @form 400 */ 401 /** 402 * Placeholder displayed on load 403 * 404 * @param { string | Resource } value 405 * @returns { ImageAttribute } 406 * @syscap SystemCapability.ArkUI.ArkUI.Full 407 * @crossplatform 408 * @atomicservice 409 * @since 11 410 * @form 411 */ 412 alt(value: string | Resource): ImageAttribute; 413 414 /** 415 * match Text Direction 416 * 417 * @param { boolean } value 418 * @returns { ImageAttribute } 419 * @syscap SystemCapability.ArkUI.ArkUI.Full 420 * @since 7 421 */ 422 /** 423 * match Text Direction 424 * 425 * @param { boolean } value 426 * @returns { ImageAttribute } 427 * @syscap SystemCapability.ArkUI.ArkUI.Full 428 * @since 9 429 * @form 430 */ 431 /** 432 * match Text Direction 433 * 434 * @param { boolean } value 435 * @returns { ImageAttribute } 436 * @syscap SystemCapability.ArkUI.ArkUI.Full 437 * @crossplatform 438 * @since 10 439 * @form 440 */ 441 /** 442 * match Text Direction 443 * 444 * @param { boolean } value 445 * @returns { ImageAttribute } 446 * @syscap SystemCapability.ArkUI.ArkUI.Full 447 * @crossplatform 448 * @atomicservice 449 * @since 11 450 * @form 451 */ 452 matchTextDirection(value: boolean): ImageAttribute; 453 454 /** 455 * Indicates whether the image follows the text direction. 456 * 457 * @param { boolean } value 458 * @returns { ImageAttribute } 459 * @syscap SystemCapability.ArkUI.ArkUI.Full 460 * @since 7 461 */ 462 /** 463 * Indicates whether the image follows the text direction. 464 * 465 * @param { boolean } value 466 * @returns { ImageAttribute } 467 * @syscap SystemCapability.ArkUI.ArkUI.Full 468 * @since 9 469 * @form 470 */ 471 /** 472 * Indicates whether the image follows the text direction. 473 * 474 * @param { boolean } value 475 * @returns { ImageAttribute } 476 * @syscap SystemCapability.ArkUI.ArkUI.Full 477 * @crossplatform 478 * @since 10 479 * @form 480 */ 481 /** 482 * Indicates whether the image follows the text direction. 483 * 484 * @param { boolean } value 485 * @returns { ImageAttribute } 486 * @syscap SystemCapability.ArkUI.ArkUI.Full 487 * @crossplatform 488 * @atomicservice 489 * @since 11 490 * @form 491 */ 492 fitOriginalSize(value: boolean): ImageAttribute; 493 494 /** 495 * fill Color 496 * 497 * @param { ResourceColor } value 498 * @returns { ImageAttribute } 499 * @syscap SystemCapability.ArkUI.ArkUI.Full 500 * @since 7 501 */ 502 /** 503 * fill Color 504 * 505 * @param { ResourceColor } value 506 * @returns { ImageAttribute } 507 * @syscap SystemCapability.ArkUI.ArkUI.Full 508 * @since 9 509 * @form 510 */ 511 /** 512 * fill Color 513 * 514 * @param { ResourceColor } value 515 * @returns { ImageAttribute } 516 * @syscap SystemCapability.ArkUI.ArkUI.Full 517 * @crossplatform 518 * @since 10 519 * @form 520 */ 521 /** 522 * fill Color 523 * 524 * @param { ResourceColor } value 525 * @returns { ImageAttribute } 526 * @syscap SystemCapability.ArkUI.ArkUI.Full 527 * @crossplatform 528 * @atomicservice 529 * @since 11 530 * @form 531 */ 532 fillColor(value: ResourceColor): ImageAttribute; 533 534 /** 535 * Sets the zoom type of an image. 536 * 537 * @param { ImageFit } value 538 * @returns { ImageAttribute } 539 * @syscap SystemCapability.ArkUI.ArkUI.Full 540 * @since 7 541 */ 542 /** 543 * Sets the zoom type of an image. 544 * 545 * @param { ImageFit } value 546 * @returns { ImageAttribute } 547 * @syscap SystemCapability.ArkUI.ArkUI.Full 548 * @since 9 549 * @form 550 */ 551 /** 552 * Sets the zoom type of an image. 553 * 554 * @param { ImageFit } value 555 * @returns { ImageAttribute } 556 * @syscap SystemCapability.ArkUI.ArkUI.Full 557 * @crossplatform 558 * @since 10 559 * @form 560 */ 561 /** 562 * Sets the zoom type of an image. 563 * 564 * @param { ImageFit } value 565 * @returns { ImageAttribute } 566 * @syscap SystemCapability.ArkUI.ArkUI.Full 567 * @crossplatform 568 * @atomicservice 569 * @since 11 570 * @form 571 */ 572 objectFit(value: ImageFit): ImageAttribute; 573 574 /** 575 * Set the repeat style of the picture 576 * 577 * @param { ImageRepeat } value 578 * @returns { ImageAttribute } 579 * @syscap SystemCapability.ArkUI.ArkUI.Full 580 * @since 7 581 */ 582 /** 583 * Set the repeat style of the picture 584 * 585 * @param { ImageRepeat } value 586 * @returns { ImageAttribute } 587 * @syscap SystemCapability.ArkUI.ArkUI.Full 588 * @since 9 589 * @form 590 */ 591 /** 592 * Set the repeat style of the picture 593 * 594 * @param { ImageRepeat } value 595 * @returns { ImageAttribute } 596 * @syscap SystemCapability.ArkUI.ArkUI.Full 597 * @crossplatform 598 * @since 10 599 * @form 600 */ 601 /** 602 * Set the repeat style of the picture 603 * 604 * @param { ImageRepeat } value 605 * @returns { ImageAttribute } 606 * @syscap SystemCapability.ArkUI.ArkUI.Full 607 * @crossplatform 608 * @atomicservice 609 * @since 11 610 * @form 611 */ 612 objectRepeat(value: ImageRepeat): ImageAttribute; 613 614 /** 615 * Set the auto style of the picture 616 * 617 * @param { boolean } value 618 * @returns { ImageAttribute } 619 * @syscap SystemCapability.ArkUI.ArkUI.Full 620 * @since 7 621 */ 622 /** 623 * Set the auto style of the picture 624 * 625 * @param { boolean } value 626 * @returns { ImageAttribute } 627 * @syscap SystemCapability.ArkUI.ArkUI.Full 628 * @since 9 629 * @form 630 */ 631 /** 632 * Set the auto style of the picture 633 * 634 * @param { boolean } value 635 * @returns { ImageAttribute } 636 * @syscap SystemCapability.ArkUI.ArkUI.Full 637 * @crossplatform 638 * @since 10 639 * @form 640 */ 641 /** 642 * Set the auto style of the picture 643 * 644 * @param { boolean } value 645 * @returns { ImageAttribute } 646 * @syscap SystemCapability.ArkUI.ArkUI.Full 647 * @crossplatform 648 * @atomicservice 649 * @since 11 650 * @form 651 */ 652 autoResize(value: boolean): ImageAttribute; 653 654 /** 655 * Sets the image rendering mode. 656 * 657 * @param { ImageRenderMode } value 658 * @returns { ImageAttribute } 659 * @syscap SystemCapability.ArkUI.ArkUI.Full 660 * @since 7 661 */ 662 /** 663 * Sets the image rendering mode. 664 * 665 * @param { ImageRenderMode } value 666 * @returns { ImageAttribute } 667 * @syscap SystemCapability.ArkUI.ArkUI.Full 668 * @since 9 669 * @form 670 */ 671 /** 672 * Sets the image rendering mode. 673 * 674 * @param { ImageRenderMode } value 675 * @returns { ImageAttribute } 676 * @syscap SystemCapability.ArkUI.ArkUI.Full 677 * @crossplatform 678 * @since 10 679 * @form 680 */ 681 /** 682 * Sets the image rendering mode. 683 * 684 * @param { ImageRenderMode } value 685 * @returns { ImageAttribute } 686 * @syscap SystemCapability.ArkUI.ArkUI.Full 687 * @crossplatform 688 * @atomicservice 689 * @since 11 690 * @form 691 */ 692 renderMode(value: ImageRenderMode): ImageAttribute; 693 694 /** 695 * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. 696 * 697 * @param { ImageInterpolation } value 698 * @returns { ImageAttribute } 699 * @syscap SystemCapability.ArkUI.ArkUI.Full 700 * @since 7 701 */ 702 /** 703 * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. 704 * 705 * @param { ImageInterpolation } value 706 * @returns { ImageAttribute } 707 * @syscap SystemCapability.ArkUI.ArkUI.Full 708 * @since 9 709 * @form 710 */ 711 /** 712 * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. 713 * 714 * @param { ImageInterpolation } value 715 * @returns { ImageAttribute } 716 * @syscap SystemCapability.ArkUI.ArkUI.Full 717 * @crossplatform 718 * @since 10 719 * @form 720 */ 721 /** 722 * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. 723 * 724 * @param { ImageInterpolation } value 725 * @returns { ImageAttribute } 726 * @syscap SystemCapability.ArkUI.ArkUI.Full 727 * @crossplatform 728 * @atomicservice 729 * @since 11 730 * @form 731 */ 732 interpolation(value: ImageInterpolation): ImageAttribute; 733 734 /** 735 * Specifies the picture decoding size. 736 * The original picture is decoded into a picture of a specified size. The unit of the number type is px. 737 * 738 * @param { object } value 739 * @returns { ImageAttribute } 740 * @syscap SystemCapability.ArkUI.ArkUI.Full 741 * @since 7 742 */ 743 /** 744 * Specifies the picture decoding size. 745 * The original picture is decoded into a picture of a specified size. The unit of the number type is px. 746 * 747 * @param { object } value 748 * @returns { ImageAttribute } 749 * @syscap SystemCapability.ArkUI.ArkUI.Full 750 * @since 9 751 * @form 752 */ 753 /** 754 * Specifies the picture decoding size. 755 * The original picture is decoded into a picture of a specified size. The unit of the number type is px. 756 * 757 * @param { object } value 758 * @returns { ImageAttribute } 759 * @syscap SystemCapability.ArkUI.ArkUI.Full 760 * @crossplatform 761 * @since 10 762 * @form 763 */ 764 /** 765 * Specifies the picture decoding size. 766 * The original picture is decoded into a picture of a specified size. The unit of the number type is px. 767 * 768 * @param { object } value 769 * @returns { ImageAttribute } 770 * @syscap SystemCapability.ArkUI.ArkUI.Full 771 * @crossplatform 772 * @atomicservice 773 * @since 11 774 * @form 775 */ 776 sourceSize(value: { width: number; height: number }): ImageAttribute; 777 778 /** 779 * Sets the synchronous or asynchronous mode for image loading. 780 * The default parameter type is bool, and the default value is false. 781 * 782 * @param { boolean } value 783 * @returns { ImageAttribute } 784 * @syscap SystemCapability.ArkUI.ArkUI.Full 785 * @since 8 786 */ 787 /** 788 * Sets the synchronous or asynchronous mode for image loading. 789 * The default parameter type is bool, and the default value is false. 790 * 791 * @param { boolean } value 792 * @returns { ImageAttribute } 793 * @syscap SystemCapability.ArkUI.ArkUI.Full 794 * @since 9 795 * @form 796 */ 797 /** 798 * Sets the synchronous or asynchronous mode for image loading. 799 * The default parameter type is bool, and the default value is false. 800 * 801 * @param { boolean } value 802 * @returns { ImageAttribute } 803 * @syscap SystemCapability.ArkUI.ArkUI.Full 804 * @crossplatform 805 * @since 10 806 * @form 807 */ 808 /** 809 * Sets the synchronous or asynchronous mode for image loading. 810 * The default parameter type is bool, and the default value is false. 811 * 812 * @param { boolean } value 813 * @returns { ImageAttribute } 814 * @syscap SystemCapability.ArkUI.ArkUI.Full 815 * @crossplatform 816 * @atomicservice 817 * @since 11 818 * @form 819 */ 820 syncLoad(value: boolean): ImageAttribute; 821 822 /** 823 * Sets the color filter effect on the image. 824 * 825 * @param { ColorFilter } value ColorFilter object. 826 * @returns { ImageAttribute } 827 * @syscap SystemCapability.ArkUI.ArkUI.Full 828 * @since 9 829 * @form 830 */ 831 /** 832 * Sets the color filter effect on the image. 833 * 834 * @param { ColorFilter } value ColorFilter object. 835 * @returns { ImageAttribute } 836 * @syscap SystemCapability.ArkUI.ArkUI.Full 837 * @crossplatform 838 * @since 10 839 * @form 840 */ 841 /** 842 * Sets the color filter effect on the image. 843 * 844 * @param { ColorFilter } value ColorFilter object. 845 * @returns { ImageAttribute } 846 * @syscap SystemCapability.ArkUI.ArkUI.Full 847 * @crossplatform 848 * @atomicservice 849 * @since 11 850 * @form 851 */ 852 colorFilter(value: ColorFilter): ImageAttribute; 853 854 /** 855 * Allow replication. 856 * 857 * @param { CopyOptions } value 858 * @returns { ImageAttribute } 859 * @syscap SystemCapability.ArkUI.ArkUI.Full 860 * @since 9 861 * @form 862 */ 863 /** 864 * Allow replication. 865 * 866 * @param { CopyOptions } value 867 * @returns { ImageAttribute } 868 * @syscap SystemCapability.ArkUI.ArkUI.Full 869 * @crossplatform 870 * @since 10 871 * @form 872 */ 873 /** 874 * Allow replication. 875 * 876 * @param { CopyOptions } value 877 * @returns { ImageAttribute } 878 * @syscap SystemCapability.ArkUI.ArkUI.Full 879 * @crossplatform 880 * @atomicservice 881 * @since 11 882 * @form 883 */ 884 copyOption(value: CopyOptions): ImageAttribute; 885 886 /** 887 * Enable image dragging. 888 * Default value is false. 889 * 890 * @param { boolean } value 891 * @returns { ImageAttribute } 892 * @syscap SystemCapability.ArkUI.ArkUI.Full 893 * @since 9 894 */ 895 /** 896 * Enable image dragging. 897 * Default value is false. 898 * 899 * @param { boolean } value 900 * @returns { ImageAttribute } 901 * @syscap SystemCapability.ArkUI.ArkUI.Full 902 * @atomicservice 903 * @since 11 904 */ 905 draggable(value: boolean): ImageAttribute; 906 907 /** 908 * Defines the PointLight 909 * 910 * @param { PointLightStyle } value - The point light style. 911 * @returns { ImageAttribute } The attribute of the image. 912 * @syscap SystemCapability.ArkUI.ArkUI.Full 913 * @systemapi 914 * @since 11 915 */ 916 pointLight(value: PointLightStyle): ImageAttribute; 917 918 /** 919 * SVG anti-aliasing. 920 * The range of the parameter values is (0.333, 1.333]. 921 * Default value is 0.0. 922 * 923 * @param { number } value - The degree of anti-aliasing. 924 * @returns { ImageAttribute } The attribute of the image. 925 * @syscap SystemCapability.ArkUI.ArkUI.Full 926 * @systemapi 927 * @since 11 928 */ 929 edgeAntialiasing(value: number): ImageAttribute; 930 931 /** 932 * This callback is triggered when an image is successfully loaded. 933 * The size of the image source that is successfully loaded is returned, in pixels. 934 * 935 * @param { function } callback 936 * @returns { ImageAttribute } 937 * @syscap SystemCapability.ArkUI.ArkUI.Full 938 * @since 7 939 */ 940 /** 941 * This callback is triggered when an image is successfully loaded. 942 * The size of the image source that is successfully loaded is returned, in pixels. 943 * 944 * @param { function } callback 945 * @returns { ImageAttribute } 946 * @syscap SystemCapability.ArkUI.ArkUI.Full 947 * @since 9 948 * @form 949 */ 950 /** 951 * This callback is triggered when an image is successfully loaded. 952 * The size of the image source that is successfully loaded is returned, in pixels. 953 * 954 * @param { function } callback 955 * @returns { ImageAttribute } 956 * @syscap SystemCapability.ArkUI.ArkUI.Full 957 * @crossplatform 958 * @since 10 959 * @form 960 */ 961 /** 962 * This callback is triggered when an image is successfully loaded. 963 * The size of the image source that is successfully loaded is returned, in pixels. 964 * 965 * @param { function } callback 966 * @returns { ImageAttribute } 967 * @syscap SystemCapability.ArkUI.ArkUI.Full 968 * @crossplatform 969 * @atomicservice 970 * @since 11 971 * @form 972 */ 973 onComplete( 974 callback: (event?: { 975 /** 976 * The width of the image source. 977 * 978 * @type { number } 979 * @syscap SystemCapability.ArkUI.ArkUI.Full 980 * @since 7 981 */ 982 /** 983 * The width of the image source. 984 * 985 * @type { number } 986 * @syscap SystemCapability.ArkUI.ArkUI.Full 987 * @since 9 988 * @form 989 */ 990 /** 991 * The width of the image source. 992 * 993 * @type { number } 994 * @syscap SystemCapability.ArkUI.ArkUI.Full 995 * @crossplatform 996 * @since 10 997 * @form 998 */ 999 /** 1000 * The width of the image source. 1001 * 1002 * @type { number } 1003 * @syscap SystemCapability.ArkUI.ArkUI.Full 1004 * @crossplatform 1005 * @atomicservice 1006 * @since 11 1007 * @form 1008 */ 1009 width: number; 1010 /** 1011 * The height of the image source. 1012 * 1013 * @type { number } 1014 * @syscap SystemCapability.ArkUI.ArkUI.Full 1015 * @since 7 1016 */ 1017 /** 1018 * The height of the image source. 1019 * 1020 * @type { number } 1021 * @syscap SystemCapability.ArkUI.ArkUI.Full 1022 * @since 9 1023 * @form 1024 */ 1025 /** 1026 * The height of the image source. 1027 * 1028 * @type { number } 1029 * @syscap SystemCapability.ArkUI.ArkUI.Full 1030 * @crossplatform 1031 * @since 10 1032 * @form 1033 */ 1034 /** 1035 * The height of the image source. 1036 * 1037 * @type { number } 1038 * @syscap SystemCapability.ArkUI.ArkUI.Full 1039 * @crossplatform 1040 * @atomicservice 1041 * @since 11 1042 * @form 1043 */ 1044 height: number; 1045 /** 1046 * The width of the component source. 1047 * 1048 * @type { number } 1049 * @syscap SystemCapability.ArkUI.ArkUI.Full 1050 * @since 7 1051 */ 1052 /** 1053 * The width of the component source. 1054 * 1055 * @type { number } 1056 * @syscap SystemCapability.ArkUI.ArkUI.Full 1057 * @since 9 1058 * @form 1059 */ 1060 /** 1061 * The width of the component source. 1062 * 1063 * @type { number } 1064 * @syscap SystemCapability.ArkUI.ArkUI.Full 1065 * @crossplatform 1066 * @since 10 1067 * @form 1068 */ 1069 /** 1070 * The width of the component source. 1071 * 1072 * @type { number } 1073 * @syscap SystemCapability.ArkUI.ArkUI.Full 1074 * @crossplatform 1075 * @atomicservice 1076 * @since 11 1077 * @form 1078 */ 1079 componentWidth: number; 1080 /** 1081 * The height of the component source. 1082 * 1083 * @type { number } 1084 * @syscap SystemCapability.ArkUI.ArkUI.Full 1085 * @since 7 1086 */ 1087 /** 1088 * The height of the component source. 1089 * 1090 * @type { number } 1091 * @syscap SystemCapability.ArkUI.ArkUI.Full 1092 * @since 9 1093 * @form 1094 */ 1095 /** 1096 * The height of the component source. 1097 * 1098 * @type { number } 1099 * @syscap SystemCapability.ArkUI.ArkUI.Full 1100 * @crossplatform 1101 * @since 10 1102 * @form 1103 */ 1104 /** 1105 * The height of the component source. 1106 * 1107 * @type { number } 1108 * @syscap SystemCapability.ArkUI.ArkUI.Full 1109 * @crossplatform 1110 * @atomicservice 1111 * @since 11 1112 * @form 1113 */ 1114 componentHeight: number; 1115 /** 1116 * The value of the status of the image being loaded successfully. 1117 * If the returned status value is 0, the image data is successfully loaded. 1118 * If the returned status value is 1, the image is successfully decoded. 1119 * 1120 * @type { number } 1121 * @syscap SystemCapability.ArkUI.ArkUI.Full 1122 * @since 7 1123 */ 1124 /** 1125 * The value of the status of the image being loaded successfully. 1126 * If the returned status value is 0, the image data is successfully loaded. 1127 * If the returned status value is 1, the image is successfully decoded. 1128 * 1129 * @type { number } 1130 * @syscap SystemCapability.ArkUI.ArkUI.Full 1131 * @since 9 1132 * @form 1133 */ 1134 /** 1135 * The value of the status of the image being loaded successfully. 1136 * If the returned status value is 0, the image data is successfully loaded. 1137 * If the returned status value is 1, the image is successfully decoded. 1138 * 1139 * @type { number } 1140 * @syscap SystemCapability.ArkUI.ArkUI.Full 1141 * @crossplatform 1142 * @since 10 1143 * @form 1144 */ 1145 /** 1146 * The value of the status of the image being loaded successfully. 1147 * If the returned status value is 0, the image data is successfully loaded. 1148 * If the returned status value is 1, the image is successfully decoded. 1149 * 1150 * @type { number } 1151 * @syscap SystemCapability.ArkUI.ArkUI.Full 1152 * @crossplatform 1153 * @atomicservice 1154 * @since 11 1155 * @form 1156 */ 1157 loadingStatus: number; 1158 /** 1159 * The width of the picture that is actually drawn. 1160 * 1161 * @type { number } 1162 * @syscap SystemCapability.ArkUI.ArkUI.Full 1163 * @crossplatform 1164 * @since 10 1165 * @form 1166 */ 1167 /** 1168 * The width of the picture that is actually drawn. 1169 * 1170 * @type { number } 1171 * @syscap SystemCapability.ArkUI.ArkUI.Full 1172 * @crossplatform 1173 * @atomicservice 1174 * @since 11 1175 * @form 1176 */ 1177 contentWidth: number; 1178 /** 1179 * The height of the picture that is actually drawn. 1180 * 1181 * @type { number } 1182 * @syscap SystemCapability.ArkUI.ArkUI.Full 1183 * @crossplatform 1184 * @since 10 1185 * @form 1186 */ 1187 /** 1188 * The height of the picture that is actually drawn. 1189 * 1190 * @type { number } 1191 * @syscap SystemCapability.ArkUI.ArkUI.Full 1192 * @crossplatform 1193 * @atomicservice 1194 * @since 11 1195 * @form 1196 */ 1197 contentHeight: number; 1198 /** 1199 * The actual draw is offset from the x-axis of the component itself. 1200 * 1201 * @type { number } 1202 * @syscap SystemCapability.ArkUI.ArkUI.Full 1203 * @crossplatform 1204 * @since 10 1205 * @form 1206 */ 1207 /** 1208 * The actual draw is offset from the x-axis of the component itself. 1209 * 1210 * @type { number } 1211 * @syscap SystemCapability.ArkUI.ArkUI.Full 1212 * @crossplatform 1213 * @atomicservice 1214 * @since 11 1215 * @form 1216 */ 1217 contentOffsetX: number; 1218 /** 1219 * The actual draw is offset from the y-axis of the component itself. 1220 * 1221 * @type { number } 1222 * @syscap SystemCapability.ArkUI.ArkUI.Full 1223 * @crossplatform 1224 * @since 10 1225 * @form 1226 */ 1227 /** 1228 * The actual draw is offset from the y-axis of the component itself. 1229 * 1230 * @type { number } 1231 * @syscap SystemCapability.ArkUI.ArkUI.Full 1232 * @crossplatform 1233 * @atomicservice 1234 * @since 11 1235 * @form 1236 */ 1237 contentOffsetY: number; 1238 }) => void, 1239 ): ImageAttribute; 1240 1241 /** 1242 * This callback is triggered when an exception occurs during image loading. 1243 * The field of "message" carries the detailed information of failed image loading. 1244 * 1245 * @param { function } callback 1246 * @returns { ImageAttribute } 1247 * @syscap SystemCapability.ArkUI.ArkUI.Full 1248 * @since 9 1249 * @form 1250 */ 1251 /** 1252 * This callback is triggered when an exception occurs during image loading. 1253 * The field of "message" carries the detailed information of failed image loading. 1254 * 1255 * @param { function } callback 1256 * @returns { ImageAttribute } 1257 * @syscap SystemCapability.ArkUI.ArkUI.Full 1258 * @crossplatform 1259 * @since 10 1260 * @form 1261 */ 1262 /** 1263 * This callback is triggered when an exception occurs during image loading. 1264 * The field of "message" carries the detailed information of failed image loading. 1265 * 1266 * @param { ImageErrorCallback } callback 1267 * @returns { ImageAttribute } 1268 * @syscap SystemCapability.ArkUI.ArkUI.Full 1269 * @crossplatform 1270 * @atomicservice 1271 * @since 11 1272 * @form 1273 */ 1274 onError(callback: ImageErrorCallback): ImageAttribute; 1275 1276 /** 1277 * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. 1278 * If the svg image is a wireless loop image, this callback is not triggered. 1279 * 1280 * @param { function } event 1281 * @returns { ImageAttribute } 1282 * @syscap SystemCapability.ArkUI.ArkUI.Full 1283 * @since 7 1284 */ 1285 /** 1286 * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. 1287 * If the svg image is a wireless loop image, this callback is not triggered. 1288 * 1289 * @param { function } event 1290 * @returns { ImageAttribute } 1291 * @syscap SystemCapability.ArkUI.ArkUI.Full 1292 * @since 9 1293 * @form 1294 */ 1295 /** 1296 * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. 1297 * If the svg image is a wireless loop image, this callback is not triggered. 1298 * 1299 * @param { function } event 1300 * @returns { ImageAttribute } 1301 * @syscap SystemCapability.ArkUI.ArkUI.Full 1302 * @crossplatform 1303 * @since 10 1304 * @form 1305 */ 1306 /** 1307 * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. 1308 * If the svg image is a wireless loop image, this callback is not triggered. 1309 * 1310 * @param { function } event 1311 * @returns { ImageAttribute } 1312 * @syscap SystemCapability.ArkUI.ArkUI.Full 1313 * @crossplatform 1314 * @atomicservice 1315 * @since 11 1316 * @form 1317 */ 1318 onFinish(event: () => void): ImageAttribute; 1319 1320 /** 1321 * Enable image analyzer. 1322 * 1323 * @param { boolean} config 1324 * @returns { ImageAttribute } 1325 * @syscap SystemCapability.ArkUI.ArkUI.Full 1326 * @since 11 1327 */ 1328 enableAnalyzer(enable: boolean): ImageAttribute; 1329 1330 /** 1331 * Set image analyzer with config. 1332 * 1333 * @param { ImageAnalyzerConfig } config 1334 * @returns { ImageAttribute } 1335 * @syscap SystemCapability.ArkUI.ArkUI.Full 1336 * @systemapi 1337 * @since 11 1338 */ 1339 analyzerConfig(config: ImageAnalyzerConfig): ImageAttribute; 1340 1341 /** 1342 * Set image resizable options. 1343 * 1344 * @param { ResizableOptions } value - Indicates the resizable options. 1345 * @returns { ImageAttribute } Returns the instance of the ImageAttribute. 1346 * @syscap SystemCapability.ArkUI.ArkUI.Full 1347 * @crossplatform 1348 * @since 11 1349 */ 1350 resizable(value: ResizableOptions): ImageAttribute; 1351} 1352 1353/** 1354 * Defines Image Component. 1355 * 1356 * @syscap SystemCapability.ArkUI.ArkUI.Full 1357 * @since 7 1358 */ 1359/** 1360 * Defines Image Component. 1361 * 1362 * @syscap SystemCapability.ArkUI.ArkUI.Full 1363 * @since 9 1364 * @form 1365 */ 1366/** 1367 * Defines Image Component. 1368 * 1369 * @syscap SystemCapability.ArkUI.ArkUI.Full 1370 * @crossplatform 1371 * @since 10 1372 * @form 1373 */ 1374/** 1375 * Defines Image Component. 1376 * 1377 * @syscap SystemCapability.ArkUI.ArkUI.Full 1378 * @crossplatform 1379 * @atomicservice 1380 * @since 11 1381 * @form 1382 */ 1383declare const Image: ImageInterface; 1384 1385/** 1386 * Defines Image Component instance. 1387 * 1388 * @syscap SystemCapability.ArkUI.ArkUI.Full 1389 * @since 7 1390 */ 1391/** 1392 * Defines Image Component instance. 1393 * 1394 * @syscap SystemCapability.ArkUI.ArkUI.Full 1395 * @since 9 1396 * @form 1397 */ 1398/** 1399 * Defines Image Component instance. 1400 * 1401 * @syscap SystemCapability.ArkUI.ArkUI.Full 1402 * @crossplatform 1403 * @since 10 1404 * @form 1405 */ 1406/** 1407 * Defines Image Component instance. 1408 * 1409 * @syscap SystemCapability.ArkUI.ArkUI.Full 1410 * @crossplatform 1411 * @atomicservice 1412 * @since 11 1413 * @form 1414 */ 1415declare const ImageInstance: ImageAttribute; 1416 1417/** 1418 * @type ImageErrorCallback 1419 * @syscap SystemCapability.ArkUI.ArkUI.Full 1420 * @since 9 1421 * @form 1422 */ 1423/** 1424 * @type ImageErrorCallback 1425 * @syscap SystemCapability.ArkUI.ArkUI.Full 1426 * @crossplatform 1427 * @since 10 1428 * @form 1429 */ 1430/** 1431 * @syscap SystemCapability.ArkUI.ArkUI.Full 1432 * @crossplatform 1433 * @atomicservice 1434 * @since 11 1435 * @form 1436 */ 1437type ImageErrorCallback = (error: ImageError) => void; 1438 1439/** 1440 * @interface ImageError 1441 * @syscap SystemCapability.ArkUI.ArkUI.Full 1442 * @since 9 1443 * @form 1444 */ 1445/** 1446 * @interface ImageError 1447 * @syscap SystemCapability.ArkUI.ArkUI.Full 1448 * @crossplatform 1449 * @since 10 1450 * @form 1451 */ 1452/** 1453 * @interface ImageError 1454 * @syscap SystemCapability.ArkUI.ArkUI.Full 1455 * @crossplatform 1456 * @atomicservice 1457 * @since 11 1458 * @form 1459 */ 1460declare interface ImageError { 1461 /** 1462 * Component width. 1463 * 1464 * @type { number } 1465 * @syscap SystemCapability.ArkUI.ArkUI.Full 1466 * @since 9 1467 * @form 1468 */ 1469 /** 1470 * Component width. 1471 * 1472 * @type { number } 1473 * @syscap SystemCapability.ArkUI.ArkUI.Full 1474 * @crossplatform 1475 * @since 10 1476 * @form 1477 */ 1478 /** 1479 * Component width. 1480 * 1481 * @type { number } 1482 * @syscap SystemCapability.ArkUI.ArkUI.Full 1483 * @crossplatform 1484 * @atomicservice 1485 * @since 11 1486 * @form 1487 */ 1488 componentWidth: number; 1489 1490 /** 1491 * Component height. 1492 * 1493 * @type { number } 1494 * @syscap SystemCapability.ArkUI.ArkUI.Full 1495 * @since 9 1496 * @form 1497 */ 1498 /** 1499 * Component height. 1500 * 1501 * @type { number } 1502 * @syscap SystemCapability.ArkUI.ArkUI.Full 1503 * @crossplatform 1504 * @since 10 1505 * @form 1506 */ 1507 /** 1508 * Component height. 1509 * 1510 * @type { number } 1511 * @syscap SystemCapability.ArkUI.ArkUI.Full 1512 * @crossplatform 1513 * @atomicservice 1514 * @since 11 1515 * @form 1516 */ 1517 componentHeight: number; 1518 1519 /** 1520 * Message. 1521 * 1522 * @type { string } 1523 * @syscap SystemCapability.ArkUI.ArkUI.Full 1524 * @crossplatform 1525 * @since 10 1526 * @form 1527 */ 1528 /** 1529 * Message. 1530 * 1531 * @type { string } 1532 * @syscap SystemCapability.ArkUI.ArkUI.Full 1533 * @crossplatform 1534 * @atomicservice 1535 * @since 11 1536 * @form 1537 */ 1538 message: string 1539} 1540 1541/** 1542 * Image resizable options 1543 * 1544 * @interface ResizableOptions 1545 * @syscap SystemCapability.ArkUI.ArkUI.Full 1546 * @crossplatform 1547 * @since 11 1548 */ 1549declare interface ResizableOptions { 1550 /** 1551 * Image slice widths. 1552 * 1553 * @type { ?EdgeWidths } 1554 * @syscap SystemCapability.ArkUI.ArkUI.Full 1555 * @crossplatform 1556 * @since 11 1557 */ 1558 slice?: EdgeWidths; 1559} 1560