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 * @file 18 * @kit ArkUI 19 */ 20 21/*** if arkts 1.2 */ 22import image from '../../@ohos.multimedia.image'; 23import drawing from '../../@ohos.graphics.drawing'; 24import matrix4 from '../../@ohos.matrix4' 25import { BusinessError } from '../../@ohos.base'; 26import { DrawableDescriptor } from '../../@ohos.arkui.drawableDescriptor'; 27import { ImageAIOptions, ImageAnalyzerConfig } from './imageCommon'; 28import { ResourceStr, ResourceColor, ColorFilter, EdgeWidths, ColorMetrics } from './units'; 29import { ImageFit, ImageRepeat, CopyOptions } from './enums'; 30import { Resource } from '../../global/resource'; 31import { CommonMethod, PointLightStyle, PixelMap } from './common'; 32/*** endif */ 33 34/** 35 * Use the DrawableDescriptor class to get drawable image. 36 * 37 * @syscap SystemCapability.ArkUI.ArkUI.Full 38 * @since 10 39 */ 40/** 41 * Use the DrawableDescriptor class to get drawable image. 42 * 43 * @typedef { import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor } DrawableDescriptor 44 * @syscap SystemCapability.ArkUI.ArkUI.Full 45 * @atomicservice 46 * @since 11 47 */ 48declare type DrawableDescriptor = import ('../api/@ohos.arkui.drawableDescriptor').DrawableDescriptor; 49 50/** 51 * Import the DrawingColorFilter type object for image color filter setting. 52 * 53 * @typedef { import('../api/@ohos.graphics.drawing').default.ColorFilter } DrawingColorFilter 54 * @syscap SystemCapability.ArkUI.ArkUI.Full 55 * @crossplatform 56 * @atomicservice 57 * @since 12 58 */ 59declare type DrawingColorFilter = import('../api/@ohos.graphics.drawing').default.ColorFilter; 60 61/** 62 * Import the DrawingColorFilter type object for image color filter setting. 63 * 64 * @typedef { drawing.ColorFilter } DrawingColorFilter 65 * @syscap SystemCapability.ArkUI.ArkUI.Full 66 * @crossplatform 67 * @atomicservice 68 * @since 20 69 * @arkts 1.2 70 */ 71declare type DrawingColorFilter = drawing.ColorFilter; 72 73/** 74 * Enumerates all the levels available for the image resolution quality. 75 * 76 * @typedef {import('../api/@ohos.multimedia.image').default.ResolutionQuality} ResolutionQuality 77 * @syscap SystemCapability.ArkUI.ArkUI.Full 78 * @systemapi 79 * @since 12 80 */ 81declare type ResolutionQuality = import('../api/@ohos.multimedia.image').default.ResolutionQuality; 82 83/** 84 * Enumerates all the levels available for the image resolution quality. 85 * 86 * @typedef { image.ResolutionQuality } ResolutionQuality 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @systemapi 89 * @since 20 90 * @arkts 1.2 91 */ 92declare type ResolutionQuality = image.ResolutionQuality; 93 94/** 95 * Lattice for dividing an image into grids. 96 * 97 * @typedef { import('../api/@ohos.graphics.drawing').default.Lattice } Lattice 98 * @syscap SystemCapability.ArkUI.ArkUI.Full 99 * @crossplatform 100 * @atomicservice 101 * @since 12 102 */ 103declare type DrawingLattice = import('../api/@ohos.graphics.drawing').default.Lattice; 104 105/** 106 * Lattice for dividing an image into grids. 107 * 108 * @typedef { drawing.Lattice } DrawingLattice 109 * @syscap SystemCapability.ArkUI.ArkUI.Full 110 * @crossplatform 111 * @atomicservice 112 * @since 20 113 * @arkts 1.2 114 */ 115declare type DrawingLattice = drawing.Lattice; 116 117/** 118 * Object matrix used for setting image transformations. 119 * 120 * @typedef { import('../api/@ohos.matrix4').default.Matrix4Transit } Matrix4Transit 121 * @syscap SystemCapability.ArkUI.ArkUI.Full 122 * @crossplatform 123 * @atomicservice 124 * @since 15 125 */ 126declare type ImageMatrix = import ('../api/@ohos.matrix4').default.Matrix4Transit; 127 128/** 129 * Object matrix used for setting image transformations. 130 * 131 * @typedef { matrix4.Matrix4Transit } Matrix4Transit 132 * @syscap SystemCapability.ArkUI.ArkUI.Full 133 * @crossplatform 134 * @atomicservice 135 * @since 20 136 * @arkts 1.2 137 */ 138declare type ImageMatrix = matrix4.Matrix4Transit; 139 140/** 141 * Business error in onError callback. 142 * 143 * @typedef { import('../api/@ohos.base').BusinessError<T> } BusinessError<T> 144 * @syscap SystemCapability.ArkUI.ArkUI.Full 145 * @crossplatform 146 * @form 147 * @atomicservice 148 * @since 20 149 */ 150declare type BusinessError<T> = import('../api/@ohos.base').BusinessError<T>; 151 152/** 153 * @enum { number } 154 * @syscap SystemCapability.ArkUI.ArkUI.Full 155 * @since 7 156 */ 157/** 158 * @enum { number } 159 * @syscap SystemCapability.ArkUI.ArkUI.Full 160 * @form 161 * @since 9 162 */ 163/** 164 * @enum { number } 165 * @syscap SystemCapability.ArkUI.ArkUI.Full 166 * @crossplatform 167 * @form 168 * @since 10 169 */ 170/** 171 * @enum { number } 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @crossplatform 174 * @form 175 * @atomicservice 176 * @since arkts {'1.1':'11','1.2':'20'} 177 * @arkts 1.1&1.2 178 */ 179declare enum ImageRenderMode { 180 /** 181 * Render according to the original image, including colors. 182 * 183 * @syscap SystemCapability.ArkUI.ArkUI.Full 184 * @since 7 185 */ 186 /** 187 * Render according to the original image, including colors. 188 * 189 * @syscap SystemCapability.ArkUI.ArkUI.Full 190 * @form 191 * @since 9 192 */ 193 /** 194 * Render according to the original image, including colors. 195 * 196 * @syscap SystemCapability.ArkUI.ArkUI.Full 197 * @crossplatform 198 * @form 199 * @since 10 200 */ 201 /** 202 * Render according to the original image, including colors. 203 * 204 * @syscap SystemCapability.ArkUI.ArkUI.Full 205 * @crossplatform 206 * @form 207 * @atomicservice 208 * @since arkts {'1.1':'11','1.2':'20'} 209 * @arkts 1.1&1.2 210 */ 211 Original, 212 213 /** 214 * Render the image as a template image, ignoring the color information of the image. 215 * 216 * @syscap SystemCapability.ArkUI.ArkUI.Full 217 * @since 7 218 */ 219 /** 220 * Render the image as a template image, ignoring the color information of the image. 221 * 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @form 224 * @since 9 225 */ 226 /** 227 * Render the image as a template image, ignoring the color information of the image. 228 * 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @crossplatform 231 * @form 232 * @since 10 233 */ 234 /** 235 * Render the image as a template image, ignoring the color information of the image. 236 * 237 * @syscap SystemCapability.ArkUI.ArkUI.Full 238 * @crossplatform 239 * @form 240 * @atomicservice 241 * @since arkts {'1.1':'11','1.2':'20'} 242 * @arkts 1.1&1.2 243 */ 244 Template, 245} 246 247/** 248 * Specify image's content. 249 * 250 * @enum { number } 251 * @syscap SystemCapability.ArkUI.ArkUI.Full 252 * @crossplatform 253 * @form 254 * @atomicservice 255 * @since arkts {'1.1':'12','1.2':'20'} 256 * @arkts 1.1&1.2 257 */ 258declare enum ImageContent { 259 /** 260 * Make image empty. 261 * 262 * @syscap SystemCapability.ArkUI.ArkUI.Full 263 * @crossplatform 264 * @form 265 * @atomicservice 266 * @since arkts {'1.1':'12','1.2':'20'} 267 * @arkts 1.1&1.2 268 */ 269 EMPTY = 0, 270} 271 272/** 273 * @enum { number } 274 * @syscap SystemCapability.ArkUI.ArkUI.Full 275 * @atomicservice 276 * @since arkts {'1.1':'12','1.2':'20'} 277 * @arkts 1.1&1.2 278 */ 279declare enum DynamicRangeMode { 280 /** 281 * Allow image content to use an unrestricted extended range. 282 * 283 * @syscap SystemCapability.ArkUI.ArkUI.Full 284 * @atomicservice 285 * @since arkts {'1.1':'12','1.2':'20'} 286 * @arkts 1.1&1.2 287 */ 288 HIGH = 0, 289 290 /** 291 * Allow image content to use some extended range. 292 * 293 * @syscap SystemCapability.ArkUI.ArkUI.Full 294 * @atomicservice 295 * @since arkts {'1.1':'12','1.2':'20'} 296 * @arkts 1.1&1.2 297 */ 298 CONSTRAINT = 1, 299 300 /** 301 * Restrict the image content dynamic range to the standard range. 302 * 303 * @syscap SystemCapability.ArkUI.ArkUI.Full 304 * @atomicservice 305 * @since arkts {'1.1':'12','1.2':'20'} 306 * @arkts 1.1&1.2 307 */ 308 STANDARD = 2, 309} 310 311/** 312 * @enum { number } 313 * @syscap SystemCapability.ArkUI.ArkUI.Full 314 * @since 7 315 */ 316/** 317 * @enum { number } 318 * @syscap SystemCapability.ArkUI.ArkUI.Full 319 * @form 320 * @since 9 321 */ 322/** 323 * @enum { number } 324 * @syscap SystemCapability.ArkUI.ArkUI.Full 325 * @crossplatform 326 * @form 327 * @since 10 328 */ 329/** 330 * @enum { number } 331 * @syscap SystemCapability.ArkUI.ArkUI.Full 332 * @crossplatform 333 * @form 334 * @atomicservice 335 * @since arkts {'1.1':'11','1.2':'20'} 336 * @arkts 1.1&1.2 337 */ 338declare enum ImageInterpolation { 339 /** 340 * Do not use interpolated image data. 341 * 342 * @syscap SystemCapability.ArkUI.ArkUI.Full 343 * @since 7 344 */ 345 /** 346 * Do not use interpolated image data. 347 * 348 * @syscap SystemCapability.ArkUI.ArkUI.Full 349 * @form 350 * @since 9 351 */ 352 /** 353 * Do not use interpolated image data. 354 * 355 * @syscap SystemCapability.ArkUI.ArkUI.Full 356 * @crossplatform 357 * @form 358 * @since 10 359 */ 360 /** 361 * Do not use interpolated image data. 362 * 363 * @syscap SystemCapability.ArkUI.ArkUI.Full 364 * @crossplatform 365 * @form 366 * @atomicservice 367 * @since arkts {'1.1':'11','1.2':'20'} 368 * @arkts 1.1&1.2 369 */ 370 None, 371 372 /** 373 * Low usage of interpolated image data. 374 * 375 * @syscap SystemCapability.ArkUI.ArkUI.Full 376 * @since 7 377 */ 378 /** 379 * Low usage of interpolated image data. 380 * 381 * @syscap SystemCapability.ArkUI.ArkUI.Full 382 * @form 383 * @since 9 384 */ 385 /** 386 * Low usage of interpolated image data. 387 * 388 * @syscap SystemCapability.ArkUI.ArkUI.Full 389 * @crossplatform 390 * @form 391 * @since 10 392 */ 393 /** 394 * Low usage of interpolated image data. 395 * 396 * @syscap SystemCapability.ArkUI.ArkUI.Full 397 * @crossplatform 398 * @form 399 * @atomicservice 400 * @since arkts {'1.1':'11','1.2':'20'} 401 * @arkts 1.1&1.2 402 */ 403 Low, 404 405 /** 406 * Interpolated image data is used moderately. 407 * 408 * @syscap SystemCapability.ArkUI.ArkUI.Full 409 * @since 7 410 */ 411 /** 412 * Interpolated image data is used moderately. 413 * 414 * @syscap SystemCapability.ArkUI.ArkUI.Full 415 * @form 416 * @since 9 417 */ 418 /** 419 * Interpolated image data is used moderately. 420 * 421 * @syscap SystemCapability.ArkUI.ArkUI.Full 422 * @crossplatform 423 * @form 424 * @since 10 425 */ 426 /** 427 * Interpolated image data is used moderately. 428 * 429 * @syscap SystemCapability.ArkUI.ArkUI.Full 430 * @crossplatform 431 * @form 432 * @atomicservice 433 * @since arkts {'1.1':'11','1.2':'20'} 434 * @arkts 1.1&1.2 435 */ 436 Medium, 437 438 /** 439 * High usage of interpolated image data may affect the speed of image rendering. 440 * 441 * @syscap SystemCapability.ArkUI.ArkUI.Full 442 * @since 7 443 */ 444 /** 445 * High usage of interpolated image data may affect the speed of image rendering. 446 * 447 * @syscap SystemCapability.ArkUI.ArkUI.Full 448 * @form 449 * @since 9 450 */ 451 /** 452 * High usage of interpolated image data may affect the speed of image rendering. 453 * 454 * @syscap SystemCapability.ArkUI.ArkUI.Full 455 * @crossplatform 456 * @form 457 * @since 10 458 */ 459 /** 460 * High usage of interpolated image data may affect the speed of image rendering. 461 * 462 * @syscap SystemCapability.ArkUI.ArkUI.Full 463 * @crossplatform 464 * @form 465 * @atomicservice 466 * @since arkts {'1.1':'11','1.2':'20'} 467 * @arkts 1.1&1.2 468 */ 469 High, 470} 471 472/** 473 * @enum { number } 474 * @syscap SystemCapability.ArkUI.ArkUI.Full 475 * @crossplatform 476 * @atomicservice 477 * @since arkts {'1.1':'14','1.2':'20'} 478 * @arkts 1.1&1.2 479 */ 480declare enum ImageRotateOrientation { 481 /** 482 * Rotate according to the image rotation 483 * 484 * @syscap SystemCapability.ArkUI.ArkUI.Full 485 * @crossplatform 486 * @atomicservice 487 * @since arkts {'1.1':'14','1.2':'20'} 488 * @arkts 1.1&1.2 489 */ 490 AUTO = 0, 491 492 /** 493 * Ignore the rotation of the image 494 * 495 * @syscap SystemCapability.ArkUI.ArkUI.Full 496 * @crossplatform 497 * @atomicservice 498 * @since arkts {'1.1':'14','1.2':'20'} 499 * @arkts 1.1&1.2 500 */ 501 UP = 1, 502 503 /** 504 * Based on image rotation, rotate clockwise 90 degrees 505 * 506 * @syscap SystemCapability.ArkUI.ArkUI.Full 507 * @crossplatform 508 * @atomicservice 509 * @since arkts {'1.1':'14','1.2':'20'} 510 * @arkts 1.1&1.2 511 */ 512 RIGHT = 2, 513 514 /** 515 * Based on image rotation, rotate clockwise 180 degrees 516 * 517 * @syscap SystemCapability.ArkUI.ArkUI.Full 518 * @crossplatform 519 * @atomicservice 520 * @since arkts {'1.1':'14','1.2':'20'} 521 * @arkts 1.1&1.2 522 */ 523 DOWN = 3, 524 525 /** 526 * Based on image rotation, rotate clockwise 270 degrees 527 * 528 * @syscap SystemCapability.ArkUI.ArkUI.Full 529 * @crossplatform 530 * @atomicservice 531 * @since arkts {'1.1':'14','1.2':'20'} 532 * @arkts 1.1&1.2 533 */ 534 LEFT = 4, 535 536 /** 537 * Flip the orignial image horizontally 538 * 539 * @syscap SystemCapability.ArkUI.ArkUI.Full 540 * @crossplatform 541 * @atomicservice 542 * @since 20 543 * @arkts 1.1&1.2 544 */ 545 UP_MIRRORED = 5, 546 547 /** 548 * Flip the orignial image horizontally and rotate clockwise 90 degrees 549 * 550 * @syscap SystemCapability.ArkUI.ArkUI.Full 551 * @crossplatform 552 * @atomicservice 553 * @since 20 554 * @arkts 1.1&1.2 555 */ 556 RIGHT_MIRRORED = 6, 557 558 /** 559 * Flip the orignial image vertically 560 * 561 * @syscap SystemCapability.ArkUI.ArkUI.Full 562 * @crossplatform 563 * @atomicservice 564 * @since 20 565 * @arkts 1.1&1.2 566 */ 567 DOWN_MIRRORED = 7, 568 569 /** 570 * Flip the orignial image horizontally and rotate clockwise 270 degrees 571 * 572 * @syscap SystemCapability.ArkUI.ArkUI.Full 573 * @crossplatform 574 * @atomicservice 575 * @since 20 576 * @arkts 1.1&1.2 577 */ 578 LEFT_MIRRORED = 8, 579} 580 581/** 582 * ImageCompleteEvent 583 * 584 * @interface ImageCompleteEvent 585 * @syscap SystemCapability.ArkUI.ArkUI.Full 586 * @crossplatform 587 * @form 588 * @atomicservice 589 * @since 20 590 * @arkts 1.2 591 */ 592export interface ImageCompleteEvent { 593 /** 594 * The width of the image source. 595 * 596 * @type { number } 597 * @syscap SystemCapability.ArkUI.ArkUI.Full 598 * @crossplatform 599 * @form 600 * @atomicservice 601 * @since 20 602 * @arkts 1.2 603 */ 604 width: number; 605 /** 606 * The height of the image source. 607 * 608 * @type { number } 609 * @syscap SystemCapability.ArkUI.ArkUI.Full 610 * @crossplatform 611 * @form 612 * @atomicservice 613 * @since 20 614 * @arkts 1.2 615 */ 616 height: number; 617 /** 618 * The width of the component source. 619 * 620 * @type { number } 621 * @syscap SystemCapability.ArkUI.ArkUI.Full 622 * @crossplatform 623 * @form 624 * @atomicservice 625 * @since 20 626 * @arkts 1.2 627 */ 628 componentWidth: number; 629 /** 630 * The height of the component source. 631 * 632 * @type { number } 633 * @syscap SystemCapability.ArkUI.ArkUI.Full 634 * @crossplatform 635 * @form 636 * @atomicservice 637 * @since 20 638 * @arkts 1.2 639 */ 640 componentHeight: number; 641 /** 642 * The value of the status of the image being loaded successfully. 643 * If the returned status value is 0, the image data is successfully loaded. 644 * If the returned status value is 1, the image is successfully decoded. 645 * 646 * @type { number } 647 * @syscap SystemCapability.ArkUI.ArkUI.Full 648 * @crossplatform 649 * @form 650 * @atomicservice 651 * @since 20 652 * @arkts 1.2 653 */ 654 loadingStatus: number; 655 /** 656 * The width of the picture that is actually drawn. 657 * 658 * @type { number } 659 * @syscap SystemCapability.ArkUI.ArkUI.Full 660 * @crossplatform 661 * @form 662 * @atomicservice 663 * @since 20 664 * @arkts 1.2 665 */ 666 contentWidth: number; 667 /** 668 * The height of the picture that is actually drawn. 669 * 670 * @type { number } 671 * @syscap SystemCapability.ArkUI.ArkUI.Full 672 * @crossplatform 673 * @form 674 * @atomicservice 675 * @since 20 676 * @arkts 1.2 677 */ 678 contentHeight: number; 679 /** 680 * The actual draw is offset from the x-axis of the component itself. 681 * 682 * @type { number } 683 * @syscap SystemCapability.ArkUI.ArkUI.Full 684 * @crossplatform 685 * @form 686 * @atomicservice 687 * @since 20 688 * @arkts 1.2 689 */ 690 contentOffsetX: number; 691 /** 692 * The actual draw is offset from the y-axis of the component itself. 693 * 694 * @type { number } 695 * @syscap SystemCapability.ArkUI.ArkUI.Full 696 * @crossplatform 697 * @form 698 * @atomicservice 699 * @since 20 700 * @arkts 1.2 701 */ 702 contentOffsetY: number; 703} 704 705/** 706 * @interface ImageInterface 707 * @syscap SystemCapability.ArkUI.ArkUI.Full 708 * @since 7 709 */ 710/** 711 * @interface ImageInterface 712 * @syscap SystemCapability.ArkUI.ArkUI.Full 713 * @form 714 * @since 9 715 */ 716/** 717 * @interface ImageInterface 718 * @syscap SystemCapability.ArkUI.ArkUI.Full 719 * @crossplatform 720 * @form 721 * @since 10 722 */ 723/** 724 * @interface ImageInterface 725 * @syscap SystemCapability.ArkUI.ArkUI.Full 726 * @crossplatform 727 * @form 728 * @atomicservice 729 * @since arkts {'1.1':'11','1.2':'20'} 730 * @arkts 1.1&1.2 731 */ 732interface ImageInterface { 733 /** 734 * Set src to obtain images. 735 * 736 * @param { PixelMap | ResourceStr | DrawableDescriptor } src 737 * @returns { ImageAttribute } 738 * @syscap SystemCapability.ArkUI.ArkUI.Full 739 * @since 7 740 */ 741 /** 742 * Set src to obtain images 743 * 744 * @param { PixelMap | ResourceStr | DrawableDescriptor } src 745 * @returns { ImageAttribute } 746 * @syscap SystemCapability.ArkUI.ArkUI.Full 747 * @form 748 * @since 9 749 */ 750 /** 751 * Set src to obtain images 752 * 753 * @param { PixelMap | ResourceStr | DrawableDescriptor } src 754 * @returns { ImageAttribute } 755 * @syscap SystemCapability.ArkUI.ArkUI.Full 756 * @crossplatform 757 * @form 758 * @since 10 759 */ 760 /** 761 * Set src to obtain images 762 * 763 * @param { PixelMap | ResourceStr | DrawableDescriptor } src 764 * @returns { ImageAttribute } 765 * @syscap SystemCapability.ArkUI.ArkUI.Full 766 * @crossplatform 767 * @form 768 * @atomicservice 769 * @since 11 770 */ 771 (src: PixelMap | ResourceStr | DrawableDescriptor): ImageAttribute; 772 773 /** 774 * Set src to obtain images 775 * 776 * @param { PixelMap | ResourceStr | DrawableDescriptor | ImageContent } src 777 * @returns { ImageAttribute } 778 * @syscap SystemCapability.ArkUI.ArkUI.Full 779 * @crossplatform 780 * @form 781 * @atomicservice 782 * @since arkts {'1.1':'12','1.2':'20'} 783 * @arkts 1.1&1.2 784 */ 785 (src: PixelMap | ResourceStr | DrawableDescriptor | ImageContent): ImageAttribute; 786 787 /** 788 * Set src and ai options to obtain images 789 * 790 * @param { PixelMap | ResourceStr | DrawableDescriptor } src 791 * @param { ImageAIOptions } imageAIOptions 792 * @returns { ImageAttribute } 793 * @syscap SystemCapability.ArkUI.ArkUI.Full 794 * @atomicservice 795 * @since arkts {'1.1':'12','1.2':'20'} 796 * @arkts 1.1&1.2 797 */ 798 (src: PixelMap | ResourceStr | DrawableDescriptor, imageAIOptions: ImageAIOptions): ImageAttribute; 799} 800 801/** 802 * Defines source size of image. 803 * 804 * @interface ImageSourceSize 805 * @syscap SystemCapability.ArkUI.ArkUI.Full 806 * @crossplatform 807 * @form 808 * @atomicservice 809 * @since arkts {'1.1':'18','1.2':'20'} 810 * @arkts 1.1&1.2 811 */ 812 813interface ImageSourceSize { 814 /** 815 * Set width. 816 * 817 * @type { number } 818 * @syscap SystemCapability.ArkUI.ArkUI.Full 819 * @since 7 820 */ 821 /** 822 * Set width. 823 * 824 * @type { number } 825 * @syscap SystemCapability.ArkUI.ArkUI.Full 826 * @form 827 * @since 9 828 */ 829 /** 830 * Set width. 831 * 832 * @type { number } 833 * @syscap SystemCapability.ArkUI.ArkUI.Full 834 * @crossplatform 835 * @form 836 * @since 10 837 */ 838 /** 839 * Set width. 840 * 841 * @type { number } 842 * @syscap SystemCapability.ArkUI.ArkUI.Full 843 * @crossplatform 844 * @form 845 * @atomicservice 846 * @since 11 847 */ 848 /** 849 * Set width. 850 * Anonymous Object Rectification. 851 * 852 * @type { number } 853 * @syscap SystemCapability.ArkUI.ArkUI.Full 854 * @crossplatform 855 * @form 856 * @atomicservice 857 * @since arkts {'1.1':'18','1.2':'20'} 858 * @arkts 1.1&1.2 859 */ 860 width: number; 861 862 /** 863 * Set height. 864 * 865 * @type { number } 866 * @syscap SystemCapability.ArkUI.ArkUI.Full 867 * @since 7 868 */ 869 /** 870 * Set height. 871 * 872 * @type { number } 873 * @syscap SystemCapability.ArkUI.ArkUI.Full 874 * @form 875 * @since 9 876 */ 877 /** 878 * Set height. 879 * 880 * @type { number } 881 * @syscap SystemCapability.ArkUI.ArkUI.Full 882 * @crossplatform 883 * @form 884 * @since 10 885 */ 886 /** 887 * Set height. 888 * 889 * @type { number } 890 * @syscap SystemCapability.ArkUI.ArkUI.Full 891 * @crossplatform 892 * @form 893 * @atomicservice 894 * @since 11 895 */ 896 /** 897 * Set height. 898 * Anonymous Object Rectification. 899 * 900 * @type { number } 901 * @syscap SystemCapability.ArkUI.ArkUI.Full 902 * @crossplatform 903 * @form 904 * @atomicservice 905 * @since arkts {'1.1':'18','1.2':'20'} 906 * @arkts 1.1&1.2 907 */ 908 height: number; 909} 910 911/** 912 * Defines the ColorContent. 913 * 914 * @syscap SystemCapability.ArkUI.ArkUI.Full 915 * @crossplatform 916 * @atomicservice 917 * @since arkts {'1.1':'15','1.2':'20'} 918 * @arkts 1.1&1.2 919 */ 920declare class ColorContent { 921 /** 922 * Indicates the ColorContent to original value. 923 * 924 * @type { ColorContent } 925 * @readonly 926 * @static 927 * @syscap SystemCapability.ArkUI.ArkUI.Full 928 * @crossplatform 929 * @atomicservice 930 * @since arkts {'1.1':'15','1.2':'20'} 931 * @arkts 1.1&1.2 932 */ 933 static readonly ORIGIN: ColorContent; 934} 935 936/** 937 * @extends CommonMethod<ImageAttribute> 938 * @syscap SystemCapability.ArkUI.ArkUI.Full 939 * @since 7 940 */ 941/** 942 * @extends CommonMethod<ImageAttribute> 943 * @syscap SystemCapability.ArkUI.ArkUI.Full 944 * @form 945 * @since 9 946 */ 947/** 948 * @extends CommonMethod<ImageAttribute> 949 * @syscap SystemCapability.ArkUI.ArkUI.Full 950 * @crossplatform 951 * @form 952 * @since 10 953 */ 954/** 955 * @extends CommonMethod<ImageAttribute> 956 * @syscap SystemCapability.ArkUI.ArkUI.Full 957 * @crossplatform 958 * @form 959 * @atomicservice 960 * @since arkts {'1.1':'11','1.2':'20'} 961 * @arkts 1.1&1.2 962 */ 963declare class ImageAttribute extends CommonMethod<ImageAttribute> { 964 /** 965 * Placeholder displayed on load 966 * 967 * @param { string | Resource } value 968 * @returns { ImageAttribute } 969 * @syscap SystemCapability.ArkUI.ArkUI.Full 970 * @since 7 971 */ 972 /** 973 * Placeholder displayed on load 974 * 975 * @param { string | Resource } value 976 * @returns { ImageAttribute } 977 * @syscap SystemCapability.ArkUI.ArkUI.Full 978 * @form 979 * @since 9 980 */ 981 /** 982 * Placeholder displayed on load 983 * 984 * @param { string | Resource } value 985 * @returns { ImageAttribute } 986 * @syscap SystemCapability.ArkUI.ArkUI.Full 987 * @crossplatform 988 * @form 989 * @since 10 990 */ 991 /** 992 * Placeholder displayed on load 993 * 994 * @param { string | Resource } value 995 * @returns { ImageAttribute } 996 * @syscap SystemCapability.ArkUI.ArkUI.Full 997 * @crossplatform 998 * @form 999 * @atomicservice 1000 * @since 11 1001 */ 1002 /** 1003 * Sets the placeholder image displayed during loading. 1004 * 1005 * <p><strong>NOTE</strong>: 1006 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1007 * </p> 1008 * 1009 * @param { string | Resource | PixelMap } value - Placeholder image displayed during loading, Default value is null. 1010 * @returns { ImageAttribute } 1011 * @syscap SystemCapability.ArkUI.ArkUI.Full 1012 * @crossplatform 1013 * @form 1014 * @atomicservice 1015 * @since arkts {'1.1':'12','1.2':'20'} 1016 * @arkts 1.1&1.2 1017 */ 1018 alt(value: string | Resource | PixelMap): ImageAttribute; 1019 1020 /** 1021 * match Text Direction 1022 * 1023 * @param { boolean } value 1024 * @returns { ImageAttribute } 1025 * @syscap SystemCapability.ArkUI.ArkUI.Full 1026 * @since 7 1027 */ 1028 /** 1029 * match Text Direction 1030 * 1031 * @param { boolean } value 1032 * @returns { ImageAttribute } 1033 * @syscap SystemCapability.ArkUI.ArkUI.Full 1034 * @form 1035 * @since 9 1036 */ 1037 /** 1038 * match Text Direction 1039 * 1040 * @param { boolean } value 1041 * @returns { ImageAttribute } 1042 * @syscap SystemCapability.ArkUI.ArkUI.Full 1043 * @crossplatform 1044 * @form 1045 * @since 10 1046 */ 1047 /** 1048 * Specifies whether to display the image in the system language direction. 1049 * 1050 * <p><strong>NOTE</strong>: 1051 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1052 * </p> 1053 * 1054 * @param { boolean } value - Whether to display the image in the system language direction, Default value is false. 1055 * @returns { ImageAttribute } 1056 * @syscap SystemCapability.ArkUI.ArkUI.Full 1057 * @crossplatform 1058 * @form 1059 * @atomicservice 1060 * @since arkts {'1.1':'11','1.2':'20'} 1061 * @arkts 1.1&1.2 1062 */ 1063 matchTextDirection(value: boolean): ImageAttribute; 1064 1065 /** 1066 * Sets whether the display size of the image follows the source size. 1067 * 1068 * @param { boolean } value 1069 * @returns { ImageAttribute } 1070 * @syscap SystemCapability.ArkUI.ArkUI.Full 1071 * @since 7 1072 */ 1073 /** 1074 * Sets whether the display size of the image follows the source size. 1075 * 1076 * @param { boolean } value 1077 * @returns { ImageAttribute } 1078 * @syscap SystemCapability.ArkUI.ArkUI.Full 1079 * @form 1080 * @since 9 1081 */ 1082 /** 1083 * Sets whether the display size of the image follows the source size. 1084 * 1085 * @param { boolean } value 1086 * @returns { ImageAttribute } 1087 * @syscap SystemCapability.ArkUI.ArkUI.Full 1088 * @crossplatform 1089 * @form 1090 * @since 10 1091 */ 1092 /** 1093 * Sets whether the display size of the image follows the source size. 1094 * 1095 * <p><strong>NOTE</strong>: 1096 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1097 * </p> 1098 * 1099 * @param { boolean } value - Whether to fit the image to the size of the image source, Default value is false. 1100 * @returns { ImageAttribute } 1101 * @syscap SystemCapability.ArkUI.ArkUI.Full 1102 * @crossplatform 1103 * @form 1104 * @atomicservice 1105 * @since arkts {'1.1':'11','1.2':'20'} 1106 * @arkts 1.1&1.2 1107 */ 1108 fitOriginalSize(value: boolean): ImageAttribute; 1109 1110 /** 1111 * fill Color 1112 * 1113 * @param { ResourceColor } value 1114 * @returns { ImageAttribute } 1115 * @syscap SystemCapability.ArkUI.ArkUI.Full 1116 * @since 7 1117 */ 1118 /** 1119 * fill Color 1120 * 1121 * @param { ResourceColor } value 1122 * @returns { ImageAttribute } 1123 * @syscap SystemCapability.ArkUI.ArkUI.Full 1124 * @form 1125 * @since 9 1126 */ 1127 /** 1128 * fill Color 1129 * 1130 * @param { ResourceColor } value 1131 * @returns { ImageAttribute } 1132 * @syscap SystemCapability.ArkUI.ArkUI.Full 1133 * @crossplatform 1134 * @form 1135 * @since 10 1136 */ 1137 /** 1138 * Sets the fill color to be superimposed on the image. 1139 * By default, no fill color is applied. If an invalid value is passed, the system uses the default theme color: 1140 * black in light mode and white in dark mode. 1141 * 1142 * <p><strong>NOTE</strong>: 1143 * <br>This attribute applies only to SVG images. 1144 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1145 * </p> 1146 * 1147 * @param { ResourceColor } value - Fill color to be superimposed on the image. 1148 * @returns { ImageAttribute } 1149 * @syscap SystemCapability.ArkUI.ArkUI.Full 1150 * @crossplatform 1151 * @form 1152 * @atomicservice 1153 * @since arkts {'1.1':'11','1.2':'20'} 1154 * @arkts 1.1&1.2 1155 */ 1156 fillColor(value: ResourceColor): ImageAttribute; 1157 1158 /** 1159 * Sets the fill color to be superimposed on the image. 1160 * By default, no fill color is applied. If an invalid value is passed, the system uses the default theme color: 1161 * black in light mode and white in dark mode. 1162 * 1163 * <p><strong>NOTE</strong>: 1164 * <br>This attribute applies only to SVG images. 1165 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1166 * </p> 1167 * 1168 * @param { ResourceColor | ColorContent } color - Fill color to be superimposed on the image. 1169 * @returns { ImageAttribute } 1170 * @syscap SystemCapability.ArkUI.ArkUI.Full 1171 * @crossplatform 1172 * @atomicservice 1173 * @since arkts {'1.1':'15','1.2':'20'} 1174 * @arkts 1.1&1.2 1175 */ 1176 fillColor(color: ResourceColor | ColorContent): ImageAttribute; 1177 1178 /** 1179 * Sets the fill color to be superimposed on the image. 1180 * By default, no fill color is applied. If an invalid value is passed, the system uses the default theme color: 1181 * black in light mode and white in dark mode. 1182 * 1183 * <p><strong>NOTE</strong>: 1184 * <br>This attribute applies only to SVG images. 1185 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1186 * </p> 1187 * 1188 * @param { ResourceColor | ColorContent | ColorMetrics } color 1189 * @returns { ImageAttribute } 1190 * @syscap SystemCapability.ArkUI.ArkUI.Full 1191 * @crossplatform 1192 * @atomicservice 1193 * @since 20 1194 * @arkts 1.1&1.2 1195 */ 1196 fillColor(color: ResourceColor | ColorContent | ColorMetrics): ImageAttribute; 1197 1198 /** 1199 * Sets the zoom type of an image. 1200 * 1201 * @param { ImageFit } value 1202 * @returns { ImageAttribute } 1203 * @syscap SystemCapability.ArkUI.ArkUI.Full 1204 * @since 7 1205 */ 1206 /** 1207 * Sets the zoom type of an image. 1208 * 1209 * @param { ImageFit } value 1210 * @returns { ImageAttribute } 1211 * @syscap SystemCapability.ArkUI.ArkUI.Full 1212 * @form 1213 * @since 9 1214 */ 1215 /** 1216 * Sets the zoom type of an image. 1217 * 1218 * @param { ImageFit } value 1219 * @returns { ImageAttribute } 1220 * @syscap SystemCapability.ArkUI.ArkUI.Full 1221 * @crossplatform 1222 * @form 1223 * @since 10 1224 */ 1225 /** 1226 * Sets how the image is resized to fit its container. 1227 * 1228 * @param { ImageFit } value - How the image is resized to fit its container, Default value is ImageFit.Cover. 1229 * @returns { ImageAttribute } 1230 * @syscap SystemCapability.ArkUI.ArkUI.Full 1231 * @crossplatform 1232 * @form 1233 * @atomicservice 1234 * @since arkts {'1.1':'11','1.2':'20'} 1235 * @arkts 1.1&1.2 1236 */ 1237 objectFit(value: ImageFit): ImageAttribute; 1238 1239 /** 1240 * Sets the transformation matrix of the image. 1241 * 1242 * @param { ImageMatrix } matrix - Transformation matrix of the image. 1243 * @returns { ImageAttribute } 1244 * @syscap SystemCapability.ArkUI.ArkUI.Full 1245 * @crossplatform 1246 * @atomicservice 1247 * @since arkts {'1.1':'15','1.2':'20'} 1248 * @arkts 1.1&1.2 1249 */ 1250 imageMatrix(matrix: ImageMatrix): ImageAttribute; 1251 1252 /** 1253 * Set the repeat style of the picture 1254 * 1255 * @param { ImageRepeat } value 1256 * @returns { ImageAttribute } 1257 * @syscap SystemCapability.ArkUI.ArkUI.Full 1258 * @since 7 1259 */ 1260 /** 1261 * Set the repeat style of the picture 1262 * 1263 * @param { ImageRepeat } value 1264 * @returns { ImageAttribute } 1265 * @syscap SystemCapability.ArkUI.ArkUI.Full 1266 * @form 1267 * @since 9 1268 */ 1269 /** 1270 * Set the repeat style of the picture 1271 * 1272 * @param { ImageRepeat } value 1273 * @returns { ImageAttribute } 1274 * @syscap SystemCapability.ArkUI.ArkUI.Full 1275 * @crossplatform 1276 * @form 1277 * @since 10 1278 */ 1279 /** 1280 * Set the repeat style of the picture 1281 * 1282 * <p><strong>NOTE</strong>: 1283 * <br>This attribute is not applicable to SVG images. 1284 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1285 * </p> 1286 * 1287 * @param { ImageRepeat } value - How the image is repeated, Default value is ImageRepeat.NoRepeat. 1288 * @returns { ImageAttribute } 1289 * @syscap SystemCapability.ArkUI.ArkUI.Full 1290 * @crossplatform 1291 * @form 1292 * @atomicservice 1293 * @since arkts {'1.1':'11','1.2':'20'} 1294 * @arkts 1.1&1.2 1295 */ 1296 objectRepeat(value: ImageRepeat): ImageAttribute; 1297 1298 /** 1299 * Set the auto style of the picture 1300 * 1301 * @param { boolean } value 1302 * @returns { ImageAttribute } 1303 * @syscap SystemCapability.ArkUI.ArkUI.Full 1304 * @since 7 1305 */ 1306 /** 1307 * Set the auto style of the picture 1308 * 1309 * @param { boolean } value 1310 * @returns { ImageAttribute } 1311 * @syscap SystemCapability.ArkUI.ArkUI.Full 1312 * @form 1313 * @since 9 1314 */ 1315 /** 1316 * Set the auto style of the picture 1317 * 1318 * @param { boolean } value 1319 * @returns { ImageAttribute } 1320 * @syscap SystemCapability.ArkUI.ArkUI.Full 1321 * @crossplatform 1322 * @form 1323 * @since 10 1324 */ 1325 /** 1326 * Specifies whether to resize the image source based on the size of the display area during image decoding. 1327 * 1328 * <p><strong>NOTE</strong>: 1329 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor 1330 * or SVG. 1331 * </p> 1332 * 1333 * @param { boolean } value - Whether to resize the image source based on the size of the display area 1334 * during image decoding, Default value is false. 1335 * @returns { ImageAttribute } 1336 * @syscap SystemCapability.ArkUI.ArkUI.Full 1337 * @crossplatform 1338 * @form 1339 * @atomicservice 1340 * @since arkts {'1.1':'11','1.2':'20'} 1341 * @arkts 1.1&1.2 1342 */ 1343 autoResize(value: boolean): ImageAttribute; 1344 1345 /** 1346 * Sets the image rendering mode. 1347 * 1348 * @param { ImageRenderMode } value 1349 * @returns { ImageAttribute } 1350 * @syscap SystemCapability.ArkUI.ArkUI.Full 1351 * @since 7 1352 */ 1353 /** 1354 * Sets the image rendering mode. 1355 * 1356 * @param { ImageRenderMode } value 1357 * @returns { ImageAttribute } 1358 * @syscap SystemCapability.ArkUI.ArkUI.Full 1359 * @form 1360 * @since 9 1361 */ 1362 /** 1363 * Sets the image rendering mode. 1364 * 1365 * @param { ImageRenderMode } value 1366 * @returns { ImageAttribute } 1367 * @syscap SystemCapability.ArkUI.ArkUI.Full 1368 * @crossplatform 1369 * @form 1370 * @since 10 1371 */ 1372 /** 1373 * Sets the rendering mode of the image. 1374 * 1375 * <p><strong>NOTE</strong>: 1376 * <br>This attribute is not applicable to SVG images. 1377 * <br>When ColorFilter is set, this attribute is not effective. 1378 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1379 * </p> 1380 * 1381 * @param { ImageRenderMode } value - Rendering mode of the image, Default value is ImageRenderMode.Original. 1382 * @returns { ImageAttribute } 1383 * @syscap SystemCapability.ArkUI.ArkUI.Full 1384 * @crossplatform 1385 * @form 1386 * @atomicservice 1387 * @since arkts {'1.1':'11','1.2':'20'} 1388 * @arkts 1.1&1.2 1389 */ 1390 renderMode(value: ImageRenderMode): ImageAttribute; 1391 1392 /** 1393 * Sets the dynamic range of the image to be displayed. 1394 * 1395 * <p><strong>NOTE</strong>: 1396 * <br>This attribute is not applicable to SVG images. 1397 * </p> 1398 * 1399 * @param { DynamicRangeMode } value - Dynamic range of the image. 1400 * @returns { ImageAttribute } Returns the instance of the ImageAttribute, Default value is 1401 * dynamicRangeMode.Standard. 1402 * @syscap SystemCapability.ArkUI.ArkUI.Full 1403 * @atomicservice 1404 * @since arkts {'1.1':'12','1.2':'20'} 1405 * @arkts 1.1&1.2 1406 */ 1407 dynamicRangeMode(value: DynamicRangeMode): ImageAttribute; 1408 1409 /** 1410 * Set hdrBrightness for Image. 1411 * 1412 * @param { number } brightness - Control the brightness of HDR Image, Default value is 1.0. 1413 * @returns { ImageAttribute } 1414 * @syscap SystemCapability.ArkUI.ArkUI.Full 1415 * @atomicservice 1416 * @since 19 1417 */ 1418 hdrBrightness(brightness: number): ImageAttribute; 1419 1420 /** 1421 * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. 1422 * 1423 * @param { ImageInterpolation } value 1424 * @returns { ImageAttribute } 1425 * @syscap SystemCapability.ArkUI.ArkUI.Full 1426 * @since 7 1427 */ 1428 /** 1429 * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. 1430 * 1431 * @param { ImageInterpolation } value 1432 * @returns { ImageAttribute } 1433 * @syscap SystemCapability.ArkUI.ArkUI.Full 1434 * @form 1435 * @since 9 1436 */ 1437 /** 1438 * Sets the interpolation effect of an image. The interpolation effect is only magnified for the image. 1439 * 1440 * @param { ImageInterpolation } value 1441 * @returns { ImageAttribute } 1442 * @syscap SystemCapability.ArkUI.ArkUI.Full 1443 * @crossplatform 1444 * @form 1445 * @since 10 1446 */ 1447 /** 1448 * Sets the interpolation effect of the image, which can alleviate aliasing that occurs when the image is zoomed. 1449 * 1450 * <p><strong>NOTE</strong>: 1451 * <br>This attribute is not applicable to SVG images. 1452 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1453 * </p> 1454 * 1455 * @param { ImageInterpolation } value - Interpolation effect of the image, Default value is ImageInterpolation.Low. 1456 * @returns { ImageAttribute } 1457 * @syscap SystemCapability.ArkUI.ArkUI.Full 1458 * @crossplatform 1459 * @form 1460 * @atomicservice 1461 * @since arkts {'1.1':'11','1.2':'20'} 1462 * @arkts 1.1&1.2 1463 */ 1464 interpolation(value: ImageInterpolation): ImageAttribute; 1465 1466 /** 1467 * Specifies the picture decoding size. 1468 * The original picture is decoded into a picture of a specified size. The unit of the number type is px. 1469 * 1470 * @param { object } value 1471 * @returns { ImageAttribute } 1472 * @syscap SystemCapability.ArkUI.ArkUI.Full 1473 * @since 7 1474 */ 1475 /** 1476 * Specifies the picture decoding size. 1477 * The original picture is decoded into a picture of a specified size. The unit of the number type is px. 1478 * 1479 * @param { object } value 1480 * @returns { ImageAttribute } 1481 * @syscap SystemCapability.ArkUI.ArkUI.Full 1482 * @form 1483 * @since 9 1484 */ 1485 /** 1486 * Specifies the picture decoding size. 1487 * The original picture is decoded into a picture of a specified size. The unit of the number type is px. 1488 * 1489 * @param { object } value 1490 * @returns { ImageAttribute } 1491 * @syscap SystemCapability.ArkUI.ArkUI.Full 1492 * @crossplatform 1493 * @form 1494 * @since 10 1495 */ 1496 /** 1497 * Specifies the picture decoding size. 1498 * The original picture is decoded into a picture of a specified size. The unit of the number type is px. 1499 * 1500 * @param { object } value 1501 * @returns { ImageAttribute } 1502 * @syscap SystemCapability.ArkUI.ArkUI.Full 1503 * @crossplatform 1504 * @form 1505 * @atomicservice 1506 * @since 11 1507 */ 1508 /** 1509 * Sets the decoding size of the image. 1510 * The original picture is decoded into a picture of a specified size. The unit of the number type is px. 1511 * Anonymous Object Rectification. 1512 * 1513 * <p><strong>NOTE</strong>: 1514 * <br>This attribute works only when the target size is smaller than the source size. 1515 * <br>This attribute is not applicable to SVG images or PixelMap objects. 1516 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1517 * </p> 1518 * 1519 * @param { ImageSourceSize } value - Decoding size of the image. 1520 * @returns { ImageAttribute } 1521 * @syscap SystemCapability.ArkUI.ArkUI.Full 1522 * @crossplatform 1523 * @form 1524 * @atomicservice 1525 * @since arkts {'1.1':'18','1.2':'20'} 1526 * @arkts 1.1&1.2 1527 */ 1528 sourceSize(value: ImageSourceSize): ImageAttribute; 1529 1530 /** 1531 * Sets the synchronous or asynchronous mode for image loading. 1532 * The default parameter type is bool, and the default value is false. 1533 * 1534 * @param { boolean } value 1535 * @returns { ImageAttribute } 1536 * @syscap SystemCapability.ArkUI.ArkUI.Full 1537 * @since 8 1538 */ 1539 /** 1540 * Sets the synchronous or asynchronous mode for image loading. 1541 * The default parameter type is bool, and the default value is false. 1542 * 1543 * @param { boolean } value 1544 * @returns { ImageAttribute } 1545 * @syscap SystemCapability.ArkUI.ArkUI.Full 1546 * @form 1547 * @since 9 1548 */ 1549 /** 1550 * Sets the synchronous or asynchronous mode for image loading. 1551 * The default parameter type is bool, and the default value is false. 1552 * 1553 * @param { boolean } value 1554 * @returns { ImageAttribute } 1555 * @syscap SystemCapability.ArkUI.ArkUI.Full 1556 * @crossplatform 1557 * @form 1558 * @since 10 1559 */ 1560 /** 1561 * Specifies whether to load the image synchronously. 1562 * 1563 * <p><strong>NOTE</strong>: 1564 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1565 * </p> 1566 * 1567 * @param { boolean } value - Whether to load the image synchronously, Default value is false. 1568 * @returns { ImageAttribute } 1569 * @syscap SystemCapability.ArkUI.ArkUI.Full 1570 * @crossplatform 1571 * @form 1572 * @atomicservice 1573 * @since arkts {'1.1':'11','1.2':'20'} 1574 * @arkts 1.1&1.2 1575 */ 1576 syncLoad(value: boolean): ImageAttribute; 1577 1578 /** 1579 * Sets the color filter effect on the image. 1580 * 1581 * @param { ColorFilter } value ColorFilter object. 1582 * @returns { ImageAttribute } 1583 * @syscap SystemCapability.ArkUI.ArkUI.Full 1584 * @form 1585 * @since 9 1586 */ 1587 /** 1588 * Sets the color filter effect on the image. 1589 * 1590 * @param { ColorFilter } value ColorFilter object. 1591 * @returns { ImageAttribute } 1592 * @syscap SystemCapability.ArkUI.ArkUI.Full 1593 * @crossplatform 1594 * @form 1595 * @since 10 1596 */ 1597 /** 1598 * Sets the color filter effect on the image. 1599 * 1600 * @param { ColorFilter } value ColorFilter object. 1601 * @returns { ImageAttribute } 1602 * @syscap SystemCapability.ArkUI.ArkUI.Full 1603 * @crossplatform 1604 * @form 1605 * @atomicservice 1606 * @since 11 1607 */ 1608 /** 1609 * Sets the color filter for the image. 1610 * 1611 * <p><strong>NOTE</strong>: 1612 * <br>When this attribute is set, renderMode is not effective. 1613 * </p> 1614 * 1615 * @param { ColorFilter | DrawingColorFilter } value - Color filter of the image. 1616 * @returns { ImageAttribute } 1617 * @syscap SystemCapability.ArkUI.ArkUI.Full 1618 * @crossplatform 1619 * @form 1620 * @atomicservice 1621 * @since arkts {'1.1':'12','1.2':'20'} 1622 * @arkts 1.1&1.2 1623 */ 1624 colorFilter(value: ColorFilter | DrawingColorFilter): ImageAttribute; 1625 1626 /** 1627 * Allow replication. 1628 * 1629 * @param { CopyOptions } value 1630 * @returns { ImageAttribute } 1631 * @syscap SystemCapability.ArkUI.ArkUI.Full 1632 * @form 1633 * @since 9 1634 */ 1635 /** 1636 * Allow replication. 1637 * 1638 * @param { CopyOptions } value 1639 * @returns { ImageAttribute } 1640 * @syscap SystemCapability.ArkUI.ArkUI.Full 1641 * @crossplatform 1642 * @form 1643 * @since 10 1644 */ 1645 /** 1646 * Whether the image can be copied. 1647 * 1648 * <strong>NOTE</strong>: 1649 * <br>SVG images cannot be copied. 1650 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 1651 * </p> 1652 * 1653 * @param { CopyOptions } value - Specifies whether the image can be copied, Default value is CopyOptions.None. 1654 * @returns { ImageAttribute } 1655 * @syscap SystemCapability.ArkUI.ArkUI.Full 1656 * @crossplatform 1657 * @form 1658 * @atomicservice 1659 * @since arkts {'1.1':'11','1.2':'20'} 1660 * @arkts 1.1&1.2 1661 */ 1662 copyOption(value: CopyOptions): ImageAttribute; 1663 1664 /** 1665 * Enable image dragging. 1666 * Default value is false. 1667 * 1668 * @param { boolean } value - Whether the image is draggable, Default value is false. 1669 * @returns { ImageAttribute } 1670 * @syscap SystemCapability.ArkUI.ArkUI.Full 1671 * @since 9 1672 */ 1673 /** 1674 * Enable image dragging. 1675 * Default value is true. 1676 * 1677 * @param { boolean } value - Whether the image is draggable, Default value is true. 1678 * @returns { ImageAttribute } 1679 * @syscap SystemCapability.ArkUI.ArkUI.Full 1680 * @atomicservice 1681 * @since 11 1682 */ 1683 /** 1684 * Specifies whether the image is draggable. 1685 * 1686 * <p><strong>NOTE</strong>: 1687 * <br>This attribute cannot be used together with the onDragStart event. 1688 * </p> 1689 * 1690 * @param { boolean } value - Whether the image is draggable, Default value is true. 1691 * @returns { ImageAttribute } 1692 * @syscap SystemCapability.ArkUI.ArkUI.Full 1693 * @crossplatform 1694 * @atomicservice 1695 * @since arkts {'1.1':'18','1.2':'20'} 1696 * @arkts 1.1&1.2 1697 */ 1698 draggable(value: boolean): ImageAttribute; 1699 1700 /** 1701 * Defines the PointLight 1702 * 1703 * @param { PointLightStyle } value - The point light style. 1704 * @returns { ImageAttribute } The attribute of the image. 1705 * @syscap SystemCapability.ArkUI.ArkUI.Full 1706 * @systemapi 1707 * @since arkts {'1.1':'11','1.2':'20'} 1708 * @arkts 1.1&1.2 1709 */ 1710 pointLight(value: PointLightStyle): ImageAttribute; 1711 1712 /** 1713 * SVG anti-aliasing. 1714 * The range of the parameter values is (0.333, 1.333]. 1715 * Default value is 0.0. 1716 * 1717 * @param { number } value - The degree of anti-aliasing. 1718 * @returns { ImageAttribute } The attribute of the image. 1719 * @syscap SystemCapability.ArkUI.ArkUI.Full 1720 * @systemapi 1721 * @since arkts {'1.1':'11','1.2':'20'} 1722 * @arkts 1.1&1.2 1723 */ 1724 edgeAntialiasing(value: number): ImageAttribute; 1725 1726 /** 1727 * This callback is triggered when an image is successfully loaded. 1728 * The size of the image source that is successfully loaded is returned, in pixels. 1729 * 1730 * @param { function } callback 1731 * @returns { ImageAttribute } 1732 * @syscap SystemCapability.ArkUI.ArkUI.Full 1733 * @since 7 1734 */ 1735 /** 1736 * This callback is triggered when an image is successfully loaded. 1737 * The size of the image source that is successfully loaded is returned, in pixels. 1738 * 1739 * @param { function } callback 1740 * @returns { ImageAttribute } 1741 * @syscap SystemCapability.ArkUI.ArkUI.Full 1742 * @form 1743 * @since 9 1744 */ 1745 /** 1746 * This callback is triggered when an image is successfully loaded. 1747 * The size of the image source that is successfully loaded is returned, in pixels. 1748 * 1749 * @param { function } callback 1750 * @returns { ImageAttribute } 1751 * @syscap SystemCapability.ArkUI.ArkUI.Full 1752 * @crossplatform 1753 * @form 1754 * @since 10 1755 */ 1756 /** 1757 * Triggered when an image is successfully loaded or decoded. 1758 * The size of the image source that is successfully loaded is returned, in pixels. 1759 * 1760 * <p><strong>NOTE</strong>: 1761 * <br>This event is not triggered if the parameter type of the component is AnimatedDrawableDescriptor. 1762 * </p> 1763 * 1764 * @param { function } callback 1765 * @returns { ImageAttribute } 1766 * @syscap SystemCapability.ArkUI.ArkUI.Full 1767 * @crossplatform 1768 * @form 1769 * @atomicservice 1770 * @since 11 1771 */ 1772 onComplete( 1773 callback: (event?: { 1774 /** 1775 * The width of the image source. 1776 * 1777 * @type { number } 1778 * @syscap SystemCapability.ArkUI.ArkUI.Full 1779 * @since 7 1780 */ 1781 /** 1782 * The width of the image source. 1783 * 1784 * @type { number } 1785 * @syscap SystemCapability.ArkUI.ArkUI.Full 1786 * @since 9 1787 * @form 1788 */ 1789 /** 1790 * The width of the image source. 1791 * 1792 * @type { number } 1793 * @syscap SystemCapability.ArkUI.ArkUI.Full 1794 * @crossplatform 1795 * @since 10 1796 * @form 1797 */ 1798 /** 1799 * The width of the image source. 1800 * 1801 * @type { number } 1802 * @syscap SystemCapability.ArkUI.ArkUI.Full 1803 * @crossplatform 1804 * @atomicservice 1805 * @since 11 1806 * @form 1807 */ 1808 width: number; 1809 /** 1810 * The height of the image source. 1811 * 1812 * @type { number } 1813 * @syscap SystemCapability.ArkUI.ArkUI.Full 1814 * @since 7 1815 */ 1816 /** 1817 * The height of the image source. 1818 * 1819 * @type { number } 1820 * @syscap SystemCapability.ArkUI.ArkUI.Full 1821 * @since 9 1822 * @form 1823 */ 1824 /** 1825 * The height of the image source. 1826 * 1827 * @type { number } 1828 * @syscap SystemCapability.ArkUI.ArkUI.Full 1829 * @crossplatform 1830 * @since 10 1831 * @form 1832 */ 1833 /** 1834 * The height of the image source. 1835 * 1836 * @type { number } 1837 * @syscap SystemCapability.ArkUI.ArkUI.Full 1838 * @crossplatform 1839 * @atomicservice 1840 * @since 11 1841 * @form 1842 */ 1843 height: number; 1844 /** 1845 * The width of the component source. 1846 * 1847 * @type { number } 1848 * @syscap SystemCapability.ArkUI.ArkUI.Full 1849 * @since 7 1850 */ 1851 /** 1852 * The width of the component source. 1853 * 1854 * @type { number } 1855 * @syscap SystemCapability.ArkUI.ArkUI.Full 1856 * @since 9 1857 * @form 1858 */ 1859 /** 1860 * The width of the component source. 1861 * 1862 * @type { number } 1863 * @syscap SystemCapability.ArkUI.ArkUI.Full 1864 * @crossplatform 1865 * @since 10 1866 * @form 1867 */ 1868 /** 1869 * The width of the component source. 1870 * 1871 * @type { number } 1872 * @syscap SystemCapability.ArkUI.ArkUI.Full 1873 * @crossplatform 1874 * @atomicservice 1875 * @since 11 1876 * @form 1877 */ 1878 componentWidth: number; 1879 /** 1880 * The height of the component source. 1881 * 1882 * @type { number } 1883 * @syscap SystemCapability.ArkUI.ArkUI.Full 1884 * @since 7 1885 */ 1886 /** 1887 * The height of the component source. 1888 * 1889 * @type { number } 1890 * @syscap SystemCapability.ArkUI.ArkUI.Full 1891 * @since 9 1892 * @form 1893 */ 1894 /** 1895 * The height of the component source. 1896 * 1897 * @type { number } 1898 * @syscap SystemCapability.ArkUI.ArkUI.Full 1899 * @crossplatform 1900 * @since 10 1901 * @form 1902 */ 1903 /** 1904 * The height of the component source. 1905 * 1906 * @type { number } 1907 * @syscap SystemCapability.ArkUI.ArkUI.Full 1908 * @crossplatform 1909 * @atomicservice 1910 * @since 11 1911 * @form 1912 */ 1913 componentHeight: number; 1914 /** 1915 * The value of the status of the image being loaded successfully. 1916 * If the returned status value is 0, the image data is successfully loaded. 1917 * If the returned status value is 1, the image is successfully decoded. 1918 * 1919 * @type { number } 1920 * @syscap SystemCapability.ArkUI.ArkUI.Full 1921 * @since 7 1922 */ 1923 /** 1924 * The value of the status of the image being loaded successfully. 1925 * If the returned status value is 0, the image data is successfully loaded. 1926 * If the returned status value is 1, the image is successfully decoded. 1927 * 1928 * @type { number } 1929 * @syscap SystemCapability.ArkUI.ArkUI.Full 1930 * @since 9 1931 * @form 1932 */ 1933 /** 1934 * The value of the status of the image being loaded successfully. 1935 * If the returned status value is 0, the image data is successfully loaded. 1936 * If the returned status value is 1, the image is successfully decoded. 1937 * 1938 * @type { number } 1939 * @syscap SystemCapability.ArkUI.ArkUI.Full 1940 * @crossplatform 1941 * @since 10 1942 * @form 1943 */ 1944 /** 1945 * The value of the status of the image being loaded successfully. 1946 * If the returned status value is 0, the image data is successfully loaded. 1947 * If the returned status value is 1, the image is successfully decoded. 1948 * 1949 * @type { number } 1950 * @syscap SystemCapability.ArkUI.ArkUI.Full 1951 * @crossplatform 1952 * @atomicservice 1953 * @since 11 1954 * @form 1955 */ 1956 loadingStatus: number; 1957 /** 1958 * The width of the picture that is actually drawn. 1959 * 1960 * @type { number } 1961 * @syscap SystemCapability.ArkUI.ArkUI.Full 1962 * @crossplatform 1963 * @since 10 1964 * @form 1965 */ 1966 /** 1967 * The width of the picture that is actually drawn. 1968 * 1969 * @type { number } 1970 * @syscap SystemCapability.ArkUI.ArkUI.Full 1971 * @crossplatform 1972 * @atomicservice 1973 * @since 11 1974 * @form 1975 */ 1976 contentWidth: number; 1977 /** 1978 * The height of the picture that is actually drawn. 1979 * 1980 * @type { number } 1981 * @syscap SystemCapability.ArkUI.ArkUI.Full 1982 * @crossplatform 1983 * @since 10 1984 * @form 1985 */ 1986 /** 1987 * The height of the picture that is actually drawn. 1988 * 1989 * @type { number } 1990 * @syscap SystemCapability.ArkUI.ArkUI.Full 1991 * @crossplatform 1992 * @atomicservice 1993 * @since 11 1994 * @form 1995 */ 1996 contentHeight: number; 1997 /** 1998 * The actual draw is offset from the x-axis of the component itself. 1999 * 2000 * @type { number } 2001 * @syscap SystemCapability.ArkUI.ArkUI.Full 2002 * @crossplatform 2003 * @since 10 2004 * @form 2005 */ 2006 /** 2007 * The actual draw is offset from the x-axis of the component itself. 2008 * 2009 * @type { number } 2010 * @syscap SystemCapability.ArkUI.ArkUI.Full 2011 * @crossplatform 2012 * @atomicservice 2013 * @since 11 2014 * @form 2015 */ 2016 contentOffsetX: number; 2017 /** 2018 * The actual draw is offset from the y-axis of the component itself. 2019 * 2020 * @type { number } 2021 * @syscap SystemCapability.ArkUI.ArkUI.Full 2022 * @crossplatform 2023 * @since 10 2024 * @form 2025 */ 2026 /** 2027 * The actual draw is offset from the y-axis of the component itself. 2028 * 2029 * @type { number } 2030 * @syscap SystemCapability.ArkUI.ArkUI.Full 2031 * @crossplatform 2032 * @atomicservice 2033 * @since 11 2034 * @form 2035 */ 2036 contentOffsetY: number; 2037 }) => void, 2038 ): ImageAttribute; 2039 2040 /** 2041 * This callback is triggered when an image is successfully loaded. 2042 * The size of the image source that is successfully loaded is returned, in pixels. 2043 * 2044 * @param { ImageOnCompleteCallback } callback 2045 * @returns { ImageAttribute } 2046 * @syscap SystemCapability.ArkUI.ArkUI.Full 2047 * @crossplatform 2048 * @form 2049 * @atomicservice 2050 * @since 20 2051 * @arkts 1.2 2052 */ 2053 onComplete(callback: ImageOnCompleteCallback): ImageAttribute; 2054 2055 /** 2056 * This callback is triggered when an exception occurs during image loading. 2057 * The field of "message" carries the detailed information of failed image loading. 2058 * 2059 * @param { function } callback 2060 * @returns { ImageAttribute } 2061 * @syscap SystemCapability.ArkUI.ArkUI.Full 2062 * @form 2063 * @since 9 2064 */ 2065 /** 2066 * This callback is triggered when an exception occurs during image loading. 2067 * The field of "message" carries the detailed information of failed image loading. 2068 * 2069 * @param { function } callback 2070 * @returns { ImageAttribute } 2071 * @syscap SystemCapability.ArkUI.ArkUI.Full 2072 * @crossplatform 2073 * @form 2074 * @since 10 2075 */ 2076 /** 2077 * Triggered when an error occurs during image loading. 2078 * The field of "message" carries the detailed information of failed image loading. 2079 * 2080 * <p><strong>NOTE</strong>: 2081 * <br>This event is not triggered if the parameter type of the component is AnimatedDrawableDescriptor. 2082 * </p> 2083 * 2084 * @param { ImageErrorCallback } callback 2085 * @returns { ImageAttribute } 2086 * @syscap SystemCapability.ArkUI.ArkUI.Full 2087 * @crossplatform 2088 * @form 2089 * @atomicservice 2090 * @since arkts {'1.1':'11','1.2':'20'} 2091 * @arkts 1.1&1.2 2092 */ 2093 onError(callback: ImageErrorCallback): ImageAttribute; 2094 2095 /** 2096 * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. 2097 * If the svg image is a wireless loop image, this callback is not triggered. 2098 * 2099 * @param { function } event 2100 * @returns { ImageAttribute } 2101 * @syscap SystemCapability.ArkUI.ArkUI.Full 2102 * @since 7 2103 */ 2104 /** 2105 * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. 2106 * If the svg image is a wireless loop image, this callback is not triggered. 2107 * 2108 * @param { function } event 2109 * @returns { ImageAttribute } 2110 * @syscap SystemCapability.ArkUI.ArkUI.Full 2111 * @form 2112 * @since 9 2113 */ 2114 /** 2115 * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. 2116 * If the svg image is a wireless loop image, this callback is not triggered. 2117 * 2118 * @param { function } event 2119 * @returns { ImageAttribute } 2120 * @syscap SystemCapability.ArkUI.ArkUI.Full 2121 * @crossplatform 2122 * @form 2123 * @since 10 2124 */ 2125 /** 2126 * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. 2127 * If the svg image is a wireless loop image, this callback is not triggered. 2128 * 2129 * <p><strong>NOTE</strong>: 2130 * <br>Only SVG images are supported. 2131 * <br>This event is not triggered if the parameter type of the component is AnimatedDrawableDescriptor. 2132 * </p> 2133 * 2134 * @param { function } event 2135 * @returns { ImageAttribute } 2136 * @syscap SystemCapability.ArkUI.ArkUI.Full 2137 * @crossplatform 2138 * @form 2139 * @atomicservice 2140 * @since arkts {'1.1':'11','1.2':'20'} 2141 * @arkts 1.1&1.2 2142 */ 2143 onFinish(event: () => void): ImageAttribute; 2144 2145 /** 2146 * Enable image analyzer. 2147 * 2148 * @param { boolean} enable 2149 * @returns { ImageAttribute } 2150 * @syscap SystemCapability.ArkUI.ArkUI.Full 2151 * @since 11 2152 */ 2153 /** 2154 * Sets whether to enable the AI analyzer 2155 * 2156 * <p><strong>NOTE</strong>: 2157 * <br>This attribute cannot be used together with the overlay attribute. If they are set at the same time, 2158 * the CustomBuilder attribute in overlay has no effect. This attribute depends on device capabilities. 2159 * <br>Images to be analyzed must be static, non-vector images. That is, SVG and GIF images cannot be analyzed. 2160 * Pixel maps in RGBA_8888 format can be passed in for analysis. 2161 * <br>The placeholder images (specified by alt) cannot be analyzed. An image can be analyzed only when 2162 * objectRepeat is set to ImageRepeat.NoRepeat and obscured is disabled. 2163 * <br>Analysis is performed based on the complete original image. If the clip, margin, borderRadius, 2164 * position, or objectFit attribute is set, the image is not displayed completely. 2165 * If renderMode is used to apply a mask, analysis is still performed based on the complete original image. 2166 * The copyOption attribute does not affect the AI analyzer. 2167 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor. 2168 * <br>The ohos.permission.INTERNET permission must be declared. 2169 * </p> 2170 * 2171 * @param { boolean} enable - Whether to enable the AI analyzer, Default value is false. 2172 * @returns { ImageAttribute } 2173 * @syscap SystemCapability.ArkUI.ArkUI.Full 2174 * @atomicservice 2175 * @since arkts {'1.1':'12','1.2':'20'} 2176 * @arkts 1.1&1.2 2177 */ 2178 enableAnalyzer(enable: boolean): ImageAttribute; 2179 2180 /** 2181 * Set image analyzer with config. 2182 * 2183 * @param { ImageAnalyzerConfig } config 2184 * @returns { ImageAttribute } 2185 * @syscap SystemCapability.ArkUI.ArkUI.Full 2186 * @systemapi 2187 * @since arkts {'1.1':'11','1.2':'20'} 2188 * @arkts 1.1&1.2 2189 */ 2190 analyzerConfig(config: ImageAnalyzerConfig): ImageAttribute; 2191 2192 /** 2193 * Set image resizable options. 2194 * 2195 * @param { ResizableOptions } value - Indicates the resizable options. 2196 * @returns { ImageAttribute } Returns the instance of the ImageAttribute. 2197 * @syscap SystemCapability.ArkUI.ArkUI.Full 2198 * @crossplatform 2199 * @since 11 2200 */ 2201 /** 2202 * Sets the resizable image options. 2203 * 2204 * <p><strong>NOTE</strong>: 2205 * <br>Resizing is effective for drag previews and placeholder images. 2206 * <br>When ResizableOptions is set to a valid value, the objectRepeat attribute does not take effect. 2207 * <br>When the sum of the values of top and bottom is greater than the source image height, 2208 * or the sum of the values of left and right is greater than the source image width, 2209 * the ResizableOptions attribute does not take effect. 2210 * <br>This attribute does not take effect when the parameter type of the component is AnimatedDrawableDescriptor 2211 * or SVG. 2212 * </p> 2213 * 2214 * @param { ResizableOptions } value - Resizable image options. 2215 * @returns { ImageAttribute } Returns the instance of the ImageAttribute. 2216 * @syscap SystemCapability.ArkUI.ArkUI.Full 2217 * @crossplatform 2218 * @atomicservice 2219 * @since arkts {'1.1':'12','1.2':'20'} 2220 * @arkts 1.1&1.2 2221 */ 2222 resizable(value: ResizableOptions): ImageAttribute; 2223 2224 /** 2225 * Set the quality enhancement level of image. 2226 * 2227 * @param { ResolutionQuality } imageQuality 2228 * @returns { ImageAttribute } 2229 * @syscap SystemCapability.ArkUI.ArkUI.Full 2230 * @systemapi 2231 * @since arkts {'1.1':'12','1.2':'20'} 2232 * @arkts 1.1&1.2 2233 */ 2234 enhancedImageQuality(imageQuality: ResolutionQuality): ImageAttribute; 2235 2236 /** 2237 * Sets whether to secure sensitive information on widgets. 2238 * 2239 * <p><strong>NOTE</strong>: 2240 * <br>Obscuring requires widget framework support. 2241 * </p> 2242 * 2243 * @param { boolean } supported - Whether to secure sensitive information on widgets, Default value is false. 2244 * @returns { ImageAttribute } 2245 * @syscap SystemCapability.ArkUI.ArkUI.Full 2246 * @form 2247 * @atomicservice 2248 * @since arkts {'1.1':'12','1.2':'20'} 2249 * @arkts 1.1&1.2 2250 */ 2251 privacySensitive(supported: boolean): ImageAttribute; 2252 2253 /** 2254 * Sets the display orientation of the image content. 2255 * 2256 * @param { ImageRotateOrientation } orientation - Display orientation of the image content, Default value 2257 * is ImageRotateOrientation.UP. 2258 * @returns { ImageAttribute } 2259 * @syscap SystemCapability.ArkUI.ArkUI.Full 2260 * @crossplatform 2261 * @atomicservice 2262 * @since arkts {'1.1':'14','1.2':'20'} 2263 * @arkts 1.1&1.2 2264 */ 2265 orientation(orientation: ImageRotateOrientation) : ImageAttribute; 2266} 2267 2268/** 2269 * Defines Image Component. 2270 * 2271 * @syscap SystemCapability.ArkUI.ArkUI.Full 2272 * @since 7 2273 */ 2274/** 2275 * Defines Image Component. 2276 * 2277 * @syscap SystemCapability.ArkUI.ArkUI.Full 2278 * @form 2279 * @since 9 2280 */ 2281/** 2282 * Defines Image Component. 2283 * 2284 * @syscap SystemCapability.ArkUI.ArkUI.Full 2285 * @crossplatform 2286 * @form 2287 * @since 10 2288 */ 2289/** 2290 * Defines Image Component. 2291 * 2292 * <p>If flickering occurs during image loading, set <b>syncLoad</b> to <b>true</b>. 2293 * For details, see [Concurrency Optimization]{@link 2294 * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-click-to-click-response-optimization}</p> 2295 * 2296 * <p>If white blocks persist during image loading, follow the steps in [Solution to White Image Blocks]{@link 2297 * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-image-white-lump-solution}</p> 2298 * 2299 * <p>If image loading takes a long time, follow the steps in [Reducing the Loading Time of Preset Images]{@link 2300 * https://developer.huawei.com/consumer/en/doc/best-practices/bpta-texture-compression-improve-performance}</p> 2301 * 2302 * @syscap SystemCapability.ArkUI.ArkUI.Full 2303 * @crossplatform 2304 * @form 2305 * @atomicservice 2306 * @since 11 2307 */ 2308declare const Image: ImageInterface; 2309 2310/** 2311 * Defines Image Component instance. 2312 * 2313 * @syscap SystemCapability.ArkUI.ArkUI.Full 2314 * @since 7 2315 */ 2316/** 2317 * Defines Image Component instance. 2318 * 2319 * @syscap SystemCapability.ArkUI.ArkUI.Full 2320 * @form 2321 * @since 9 2322 */ 2323/** 2324 * Defines Image Component instance. 2325 * 2326 * @syscap SystemCapability.ArkUI.ArkUI.Full 2327 * @crossplatform 2328 * @form 2329 * @since 10 2330 */ 2331/** 2332 * Defines Image Component instance. 2333 * 2334 * @syscap SystemCapability.ArkUI.ArkUI.Full 2335 * @crossplatform 2336 * @form 2337 * @atomicservice 2338 * @since 11 2339 */ 2340declare const ImageInstance: ImageAttribute; 2341 2342/** 2343 * @type ImageErrorCallback 2344 * @syscap SystemCapability.ArkUI.ArkUI.Full 2345 * @form 2346 * @since 9 2347 */ 2348/** 2349 * @type ImageErrorCallback 2350 * @syscap SystemCapability.ArkUI.ArkUI.Full 2351 * @crossplatform 2352 * @form 2353 * @since 10 2354 */ 2355/** 2356 * @typedef { function } ImageErrorCallback 2357 * @param { ImageError } error 2358 * @syscap SystemCapability.ArkUI.ArkUI.Full 2359 * @crossplatform 2360 * @form 2361 * @atomicservice 2362 * @since arkts {'1.1':'11','1.2':'20'} 2363 * @arkts 1.1&1.2 2364 */ 2365type ImageErrorCallback = (error: ImageError) => void; 2366 2367/** 2368 * ImageOnCompleteCallback 2369 * 2370 * @typedef { function } ImageOnCompleteCallback 2371 * @param { ImageCompleteEvent } loadEvent 2372 * @syscap SystemCapability.ArkUI.ArkUI.Full 2373 * @crossplatform 2374 * @form 2375 * @atomicservice 2376 * @since 20 2377 * @arkts 1.2 2378 */ 2379type ImageOnCompleteCallback = (loadEvent?: ImageCompleteEvent) => void; 2380 2381/** 2382 * @interface ImageError 2383 * @syscap SystemCapability.ArkUI.ArkUI.Full 2384 * @form 2385 * @since 9 2386 */ 2387/** 2388 * @interface ImageError 2389 * @syscap SystemCapability.ArkUI.ArkUI.Full 2390 * @crossplatform 2391 * @form 2392 * @since 10 2393 */ 2394/** 2395 * @interface ImageError 2396 * @syscap SystemCapability.ArkUI.ArkUI.Full 2397 * @crossplatform 2398 * @form 2399 * @atomicservice 2400 * @since arkts {'1.1':'11','1.2':'20'} 2401 * @arkts 1.1&1.2 2402 */ 2403declare interface ImageError { 2404 /** 2405 * Component width. 2406 * 2407 * @type { number } 2408 * @syscap SystemCapability.ArkUI.ArkUI.Full 2409 * @form 2410 * @since 9 2411 */ 2412 /** 2413 * Component width. 2414 * 2415 * @type { number } 2416 * @syscap SystemCapability.ArkUI.ArkUI.Full 2417 * @crossplatform 2418 * @form 2419 * @since 10 2420 */ 2421 /** 2422 * Component width. 2423 * 2424 * @type { number } 2425 * @syscap SystemCapability.ArkUI.ArkUI.Full 2426 * @crossplatform 2427 * @form 2428 * @atomicservice 2429 * @since arkts {'1.1':'11','1.2':'20'} 2430 * @arkts 1.1&1.2 2431 */ 2432 componentWidth: number; 2433 2434 /** 2435 * Component height. 2436 * 2437 * @type { number } 2438 * @syscap SystemCapability.ArkUI.ArkUI.Full 2439 * @form 2440 * @since 9 2441 */ 2442 /** 2443 * Component height. 2444 * 2445 * @type { number } 2446 * @syscap SystemCapability.ArkUI.ArkUI.Full 2447 * @crossplatform 2448 * @form 2449 * @since 10 2450 */ 2451 /** 2452 * Component height. 2453 * 2454 * @type { number } 2455 * @syscap SystemCapability.ArkUI.ArkUI.Full 2456 * @crossplatform 2457 * @form 2458 * @atomicservice 2459 * @since arkts {'1.1':'11','1.2':'20'} 2460 * @arkts 1.1&1.2 2461 */ 2462 componentHeight: number; 2463 2464 /** 2465 * Message. 2466 * 2467 * @type { string } 2468 * @syscap SystemCapability.ArkUI.ArkUI.Full 2469 * @crossplatform 2470 * @form 2471 * @since 10 2472 */ 2473 /** 2474 * Message. 2475 * 2476 * @type { string } 2477 * @syscap SystemCapability.ArkUI.ArkUI.Full 2478 * @crossplatform 2479 * @form 2480 * @atomicservice 2481 * @since arkts {'1.1':'11','1.2':'20'} 2482 * @arkts 1.1&1.2 2483 */ 2484 message: string; 2485 2486 /** 2487 * Business Error. 2488 * 2489 * @type { ?BusinessError<void> } 2490 * @syscap SystemCapability.ArkUI.ArkUI.Full 2491 * @crossplatform 2492 * @form 2493 * @atomicservice 2494 * @since 20 2495 * @arkts 1.1&1.2 2496 */ 2497 error?: BusinessError<void>; 2498} 2499 2500/** 2501 * Image resizable options 2502 * 2503 * @interface ResizableOptions 2504 * @syscap SystemCapability.ArkUI.ArkUI.Full 2505 * @crossplatform 2506 * @since 11 2507 */ 2508/** 2509 * Image resizable options 2510 * 2511 * @interface ResizableOptions 2512 * @syscap SystemCapability.ArkUI.ArkUI.Full 2513 * @crossplatform 2514 * @atomicservice 2515 * @since arkts {'1.1':'12','1.2':'20'} 2516 * @arkts 1.1&1.2 2517 */ 2518declare interface ResizableOptions { 2519 /** 2520 * Image slice widths. 2521 * 2522 * @type { ?EdgeWidths } 2523 * @syscap SystemCapability.ArkUI.ArkUI.Full 2524 * @crossplatform 2525 * @since 11 2526 */ 2527 /** 2528 * Image slice widths. 2529 * 2530 * @type { ?EdgeWidths } 2531 * @syscap SystemCapability.ArkUI.ArkUI.Full 2532 * @crossplatform 2533 * @atomicservice 2534 * @since arkts {'1.1':'12','1.2':'20'} 2535 * @arkts 1.1&1.2 2536 */ 2537 slice?: EdgeWidths; 2538 2539 /** 2540 * Image lattice. 2541 * 2542 * @type { ?DrawingLattice } 2543 * @syscap SystemCapability.ArkUI.ArkUI.Full 2544 * @crossplatform 2545 * @atomicservice 2546 * @since arkts {'1.1':'12','1.2':'20'} 2547 * @arkts 1.1&1.2 2548 */ 2549 lattice?: DrawingLattice; 2550} 2551