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/** 22 * Import the drawing canvas type object for Canvas. 23 * 24 * @typedef { import('../api/@ohos.graphics.drawing').default.Canvas } DrawingCanvas 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @crossplatform 27 * @atomicservice 28 * @since 12 29 */ 30declare type DrawingCanvas = import('../api/@ohos.graphics.drawing').default.Canvas; 31 32/** 33 * Filling style algorithm, which determines whether a point is within or outside the path. The following 34 * two configurations are supported: 35 * "evenodd": odd and even round rule 36 * "nonzero": (Default) Non-zero Wrap Rules 37 * 38 * @typedef { "evenodd" | "nonzero" } CanvasFillRule 39 * @syscap SystemCapability.ArkUI.ArkUI.Full 40 * @since 8 41 */ 42/** 43 * Filling style algorithm, which determines whether a point is within or outside the path. The following 44 * two configurations are supported: 45 * "evenodd": odd and even round rule 46 * "nonzero": (Default) Non-zero Wrap Rules 47 * 48 * @typedef { "evenodd" | "nonzero" } CanvasFillRule 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @form 51 * @since 9 52 */ 53/** 54 * Filling style algorithm, which determines whether a point is within or outside the path. The following 55 * two configurations are supported: 56 * "evenodd": odd and even round rule 57 * "nonzero": (Default) Non-zero Wrap Rules 58 * 59 * @typedef { "evenodd" | "nonzero" } CanvasFillRule 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @form 63 * @since 10 64 */ 65/** 66 * Filling style algorithm, which determines whether a point is within or outside the path. The following 67 * two configurations are supported: 68 * "evenodd": odd and even round rule 69 * "nonzero": (Default) Non-zero Wrap Rules 70 * 71 * @typedef { "evenodd" | "nonzero" } CanvasFillRule 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @crossplatform 74 * @form 75 * @atomicservice 76 * @since 11 77 */ 78declare type CanvasFillRule = "evenodd" | "nonzero"; 79 80/** 81 * Specifies the attribute of drawing the end of each line segment. The following configurations are supported: 82 * "butt": (Default) Segment Ends in Square 83 * "round": Segment ends in a circle 84 * "square": The end of the segment ends in a square, but a rectangular area is added that is the same width 85 * as the segment and is half the thickness of the segment. 86 * 87 * @typedef { "butt" | "round" | "square" } CanvasLineCap 88 * @syscap SystemCapability.ArkUI.ArkUI.Full 89 * @since 8 90 */ 91/** 92 * Specifies the attribute of drawing the end of each line segment. The following configurations are supported: 93 * "butt": (Default) Segment Ends in Square 94 * "round": Segment ends in a circle 95 * "square": The end of the segment ends in a square, but a rectangular area is added that is the same width 96 * as the segment and is half the thickness of the segment. 97 * 98 * @typedef { "butt" | "round" | "square" } CanvasLineCap 99 * @syscap SystemCapability.ArkUI.ArkUI.Full 100 * @form 101 * @since 9 102 */ 103/** 104 * Specifies the attribute of drawing the end of each line segment. The following configurations are supported: 105 * "butt": (Default) Segment Ends in Square 106 * "round": Segment ends in a circle 107 * "square": The end of the segment ends in a square, but a rectangular area is added that is the same width 108 * as the segment and is half the thickness of the segment. 109 * 110 * @typedef { "butt" | "round" | "square" } CanvasLineCap 111 * @syscap SystemCapability.ArkUI.ArkUI.Full 112 * @crossplatform 113 * @form 114 * @since 10 115 */ 116/** 117 * Specifies the attribute of drawing the end of each line segment. The following configurations are supported: 118 * "butt": (Default) Segment Ends in Square 119 * "round": Segment ends in a circle 120 * "square": The end of the segment ends in a square, but a rectangular area is added that is the same width 121 * as the segment and is half the thickness of the segment. 122 * 123 * @typedef { "butt" | "round" | "square" } CanvasLineCap 124 * @syscap SystemCapability.ArkUI.ArkUI.Full 125 * @crossplatform 126 * @form 127 * @atomicservice 128 * @since 11 129 */ 130declare type CanvasLineCap = "butt" | "round" | "square"; 131 132/** 133 * Sets the attribute of how two connected parts (line segments, arcs, and curves) whose length is not 0 134 * are connected together. The following three configurations are supported: 135 * "bevel": Fill the ends of the connected sections with an additional triangle-base area, 136 * each with its own independent rectangular corner. 137 * "miter": (Default) An additional diamond region is formed by extending the outer edges of the connected portions 138 * so that they intersect at a point. 139 * "round": Draw the shape of the corner by filling in an additional sector with the center at the end of the 140 * connected section. The radius of the fillet is the width of the segment. 141 * 142 * @typedef { "bevel" | "miter" | "round" } CanvasLineJoin 143 * @syscap SystemCapability.ArkUI.ArkUI.Full 144 * @since 8 145 */ 146/** 147 * Sets the attribute of how two connected parts (line segments, arcs, and curves) whose length is not 0 148 * are connected together. The following three configurations are supported: 149 * "bevel": Fill the ends of the connected sections with an additional triangle-base area, 150 * each with its own independent rectangular corner. 151 * "miter": (Default) An additional diamond region is formed by extending the outer edges of the connected portions 152 * so that they intersect at a point. 153 * "round": Draw the shape of the corner by filling in an additional sector with the center at the end of the 154 * connected section. The radius of the fillet is the width of the segment. 155 * 156 * @typedef { "bevel" | "miter" | "round" } CanvasLineJoin 157 * @syscap SystemCapability.ArkUI.ArkUI.Full 158 * @form 159 * @since 9 160 */ 161/** 162 * Sets the attribute of how two connected parts (line segments, arcs, and curves) whose length is not 0 163 * are connected together. The following three configurations are supported: 164 * "bevel": Fill the ends of the connected sections with an additional triangle-base area, 165 * each with its own independent rectangular corner. 166 * "miter": (Default) An additional diamond region is formed by extending the outer edges of the connected portions 167 * so that they intersect at a point. 168 * "round": Draw the shape of the corner by filling in an additional sector with the center at the end of the 169 * connected section. The radius of the fillet is the width of the segment. 170 * 171 * @typedef { "bevel" | "miter" | "round" } CanvasLineJoin 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @crossplatform 174 * @form 175 * @since 10 176 */ 177/** 178 * Sets the attribute of how two connected parts (line segments, arcs, and curves) whose length is not 0 179 * are connected together. The following three configurations are supported: 180 * "bevel": Fill the ends of the connected sections with an additional triangle-base area, 181 * each with its own independent rectangular corner. 182 * "miter": (Default) An additional diamond region is formed by extending the outer edges of the connected portions 183 * so that they intersect at a point. 184 * "round": Draw the shape of the corner by filling in an additional sector with the center at the end of the 185 * connected section. The radius of the fillet is the width of the segment. 186 * 187 * @typedef { "bevel" | "miter" | "round" } CanvasLineJoin 188 * @syscap SystemCapability.ArkUI.ArkUI.Full 189 * @crossplatform 190 * @form 191 * @atomicservice 192 * @since 11 193 */ 194declare type CanvasLineJoin = "bevel" | "miter" | "round"; 195 196/** 197 * Indicates the attribute of the current text direction. The options are as follows: 198 * "inherit": (Default) Inherit current Canvas component settings 199 * "ltr": The text direction is left to right. 200 * "rtl": The text direction is from right to left. 201 * 202 * @typedef { "inherit" | "ltr" | "rtl" } CanvasDirection 203 * @syscap SystemCapability.ArkUI.ArkUI.Full 204 * @since 8 205 */ 206/** 207 * Indicates the attribute of the current text direction. The options are as follows: 208 * "inherit": (Default) Inherit current Canvas component settings 209 * "ltr": The text direction is left to right. 210 * "rtl": The text direction is from right to left. 211 * 212 * @typedef { "inherit" | "ltr" | "rtl" } CanvasDirection 213 * @syscap SystemCapability.ArkUI.ArkUI.Full 214 * @form 215 * @since 9 216 */ 217/** 218 * Indicates the attribute of the current text direction. The options are as follows: 219 * "inherit": (Default) Inherit current Canvas component settings 220 * "ltr": The text direction is left to right. 221 * "rtl": The text direction is from right to left. 222 * 223 * @typedef { "inherit" | "ltr" | "rtl" } CanvasDirection 224 * @syscap SystemCapability.ArkUI.ArkUI.Full 225 * @crossplatform 226 * @form 227 * @since 10 228 */ 229/** 230 * Indicates the attribute of the current text direction. The options are as follows: 231 * "inherit": (Default) Inherit current Canvas component settings 232 * "ltr": The text direction is left to right. 233 * "rtl": The text direction is from right to left. 234 * 235 * @typedef { "inherit" | "ltr" | "rtl" } CanvasDirection 236 * @syscap SystemCapability.ArkUI.ArkUI.Full 237 * @crossplatform 238 * @form 239 * @atomicservice 240 * @since 11 241 */ 242declare type CanvasDirection = "inherit" | "ltr" | "rtl"; 243 244/** 245 * Describes the alignment mode for drawing text. The options are as follows: 246 * "center": The text is centered. 247 * "end": Where text aligns lines end (Left alignment refers to the local from left to right, 248 * and right alignment refers to the local from right to left) 249 * "left": The text is left-aligned. 250 * "right": The text is right-aligned. 251 * "start": (Default) Where the text snap line begins (Left alignment refers to the local from left to right, 252 * and right alignment refers to the local from right to left) 253 * 254 * @typedef { "center" | "end" | "left" | "right" | "start" } CanvasTextAlign 255 * @syscap SystemCapability.ArkUI.ArkUI.Full 256 * @since 8 257 */ 258/** 259 * Describes the alignment mode for drawing text. The options are as follows: 260 * "center": The text is centered. 261 * "end": Where text aligns lines end (Left alignment refers to the local from left to right, 262 * and right alignment refers to the local from right to left) 263 * "left": The text is left-aligned. 264 * "right": The text is right-aligned. 265 * "start": (Default) Where the text snap line begins (Left alignment refers to the local from left to right, 266 * and right alignment refers to the local from right to left) 267 * 268 * @typedef { "center" | "end" | "left" | "right" | "start" } CanvasTextAlign 269 * @syscap SystemCapability.ArkUI.ArkUI.Full 270 * @form 271 * @since 9 272 */ 273/** 274 * Describes the alignment mode for drawing text. The options are as follows: 275 * "center": The text is centered. 276 * "end": Where text aligns lines end (Left alignment refers to the local from left to right, 277 * and right alignment refers to the local from right to left) 278 * "left": The text is left-aligned. 279 * "right": The text is right-aligned. 280 * "start": (Default) Where the text snap line begins (Left alignment refers to the local from left to right, 281 * and right alignment refers to the local from right to left) 282 * 283 * @typedef { "center" | "end" | "left" | "right" | "start" } CanvasTextAlign 284 * @syscap SystemCapability.ArkUI.ArkUI.Full 285 * @crossplatform 286 * @form 287 * @since 10 288 */ 289/** 290 * Describes the alignment mode for drawing text. The options are as follows: 291 * "center": The text is centered. 292 * "end": Where text aligns lines end (Left alignment refers to the local from left to right, 293 * and right alignment refers to the local from right to left) 294 * "left": The text is left-aligned. 295 * "right": The text is right-aligned. 296 * "start": (Default) Where the text snap line begins (Left alignment refers to the local from left to right, 297 * and right alignment refers to the local from right to left) 298 * 299 * @typedef { "center" | "end" | "left" | "right" | "start" } CanvasTextAlign 300 * @syscap SystemCapability.ArkUI.ArkUI.Full 301 * @crossplatform 302 * @form 303 * @atomicservice 304 * @since 11 305 */ 306declare type CanvasTextAlign = "center" | "end" | "left" | "right" | "start"; 307 308/** 309 * Text baseline, which supports the following configurations: 310 * "alphabetic": (Default) The text baseline is the standard letter baseline. 311 * "bottom": The text baseline is at the bottom of the text block. The difference between the ideographic baseline 312 * and the ideographic baseline is that the ideographic baseline does not need to consider downlink letters. 313 * "hanging": The text baseline is a hanging baseline. 314 * "ideographic": The text baseline is the ideographic baseline; If the character itself exceeds the alphabetic 315 * baseline, the ideographic baseline is at the bottom of the character itself. 316 * "middle": The text baseline is in the middle of the text block. 317 * "top": The text baseline is at the top of the text block. 318 * 319 * @typedef { "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" } CanvasTextBaseline 320 * @syscap SystemCapability.ArkUI.ArkUI.Full 321 * @since 8 322 */ 323/** 324 * Text baseline, which supports the following configurations: 325 * "alphabetic": (Default) The text baseline is the standard letter baseline. 326 * "bottom": The text baseline is at the bottom of the text block. The difference between the ideographic baseline 327 * and the ideographic baseline is that the ideographic baseline does not need to consider downlink letters. 328 * "hanging": The text baseline is a hanging baseline. 329 * "ideographic": The text baseline is the ideographic baseline; If the character itself exceeds the alphabetic 330 * baseline, the ideographic baseline is at the bottom of the character itself. 331 * "middle": The text baseline is in the middle of the text block. 332 * "top": The text baseline is at the top of the text block. 333 * 334 * @typedef { "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" } CanvasTextBaseline 335 * @syscap SystemCapability.ArkUI.ArkUI.Full 336 * @form 337 * @since 9 338 */ 339/** 340 * Text baseline, which supports the following configurations: 341 * "alphabetic": (Default) The text baseline is the standard letter baseline. 342 * "bottom": The text baseline is at the bottom of the text block. The difference between the ideographic baseline 343 * and the ideographic baseline is that the ideographic baseline does not need to consider downlink letters. 344 * "hanging": The text baseline is a hanging baseline. 345 * "ideographic": The text baseline is the ideographic baseline; If the character itself exceeds the alphabetic 346 * baseline, the ideographic baseline is at the bottom of the character itself. 347 * "middle": The text baseline is in the middle of the text block. 348 * "top": The text baseline is at the top of the text block. 349 * 350 * @typedef { "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" } CanvasTextBaseline 351 * @syscap SystemCapability.ArkUI.ArkUI.Full 352 * @crossplatform 353 * @form 354 * @since 10 355 */ 356/** 357 * Text baseline, which supports the following configurations: 358 * "alphabetic": (Default) The text baseline is the standard letter baseline. 359 * "bottom": The text baseline is at the bottom of the text block. The difference between the ideographic baseline 360 * and the ideographic baseline is that the ideographic baseline does not need to consider downlink letters. 361 * "hanging": The text baseline is a hanging baseline. 362 * "ideographic": The text baseline is the ideographic baseline; If the character itself exceeds the alphabetic 363 * baseline, the ideographic baseline is at the bottom of the character itself. 364 * "middle": The text baseline is in the middle of the text block. 365 * "top": The text baseline is at the top of the text block. 366 * 367 * @typedef { "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top" } CanvasTextBaseline 368 * @syscap SystemCapability.ArkUI.ArkUI.Full 369 * @crossplatform 370 * @form 371 * @atomicservice 372 * @since 11 373 */ 374declare type CanvasTextBaseline = "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top"; 375 376/** 377 * Sets the image smoothness attribute. The options are as follows: 378 * "high": height 379 * "low": (default)low 380 * "medium": medium 381 * 382 * @typedef { "high" | "low" | "medium" } ImageSmoothingQuality 383 * @syscap SystemCapability.ArkUI.ArkUI.Full 384 * @since 8 385 */ 386/** 387 * Sets the image smoothness attribute. The options are as follows: 388 * "high": height 389 * "low": (default)low 390 * "medium": medium 391 * 392 * @typedef { "high" | "low" | "medium" } ImageSmoothingQuality 393 * @syscap SystemCapability.ArkUI.ArkUI.Full 394 * @form 395 * @since 9 396 */ 397/** 398 * Sets the image smoothness attribute. The options are as follows: 399 * "high": height 400 * "low": (default)low 401 * "medium": medium 402 * 403 * @typedef { "high" | "low" | "medium" } ImageSmoothingQuality 404 * @syscap SystemCapability.ArkUI.ArkUI.Full 405 * @crossplatform 406 * @form 407 * @since 10 408 */ 409/** 410 * Sets the image smoothness attribute. The options are as follows: 411 * "high": height 412 * "low": (default)low 413 * "medium": medium 414 * 415 * @typedef { "high" | "low" | "medium" } ImageSmoothingQuality 416 * @syscap SystemCapability.ArkUI.ArkUI.Full 417 * @crossplatform 418 * @form 419 * @atomicservice 420 * @since 11 421 */ 422declare type ImageSmoothingQuality = "high" | "low" | "medium"; 423 424/** 425 * Import the frame node type object for Canvas. 426 * 427 * @typedef { import('../api/arkui/FrameNode').FrameNode } FrameNode 428 * @syscap SystemCapability.ArkUI.ArkUI.Full 429 * @crossplatform 430 * @atomicservice 431 * @since 13 432 */ 433declare type FrameNode = import('../api/arkui/FrameNode').FrameNode; 434 435/** 436 * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() 437 * 438 * @syscap SystemCapability.ArkUI.ArkUI.Full 439 * @since 8 440 */ 441/** 442 * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() 443 * 444 * @syscap SystemCapability.ArkUI.ArkUI.Full 445 * @form 446 * @since 9 447 */ 448/** 449 * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() 450 * 451 * @syscap SystemCapability.ArkUI.ArkUI.Full 452 * @crossplatform 453 * @form 454 * @since 10 455 */ 456/** 457 * Opaque objects that describe gradients, created by createLinearGradient() or createRadialGradient() 458 * 459 * @syscap SystemCapability.ArkUI.ArkUI.Full 460 * @crossplatform 461 * @form 462 * @atomicservice 463 * @since 11 464 */ 465declare class CanvasGradient { 466 /** 467 * Add a breakpoint defined by offset and color to the gradient 468 * 469 * @param { number } offset - Value between 0 and 1, out of range throws INDEX_SIZE_ERR error 470 * @param { string } color - CSS color value <color>. If the color value cannot be resolved to a valid CSS color value <color> 471 * a SYNTAX_ERR error is thrown. 472 * @syscap SystemCapability.ArkUI.ArkUI.Full 473 * @since 8 474 */ 475 /** 476 * Add a breakpoint defined by offset and color to the gradient 477 * 478 * @param { number } offset - Value between 0 and 1, out of range throws INDEX_SIZE_ERR error 479 * @param { string } color - CSS color value <color>. If the color value cannot be resolved to a valid CSS color value <color> 480 * a SYNTAX_ERR error is thrown. 481 * @syscap SystemCapability.ArkUI.ArkUI.Full 482 * @form 483 * @since 9 484 */ 485 /** 486 * Add a breakpoint defined by offset and color to the gradient 487 * 488 * @param { number } offset - Value between 0 and 1, out of range throws INDEX_SIZE_ERR error 489 * @param { string } color - Set the gradient color. 490 * a SYNTAX_ERR error is thrown. 491 * @syscap SystemCapability.ArkUI.ArkUI.Full 492 * @crossplatform 493 * @form 494 * @since 10 495 */ 496 /** 497 * Add a breakpoint defined by offset and color to the gradient 498 * 499 * @param { number } offset - Value between 0 and 1, out of range throws INDEX_SIZE_ERR error 500 * @param { string } color - Set the gradient color. 501 * a SYNTAX_ERR error is thrown. 502 * @syscap SystemCapability.ArkUI.ArkUI.Full 503 * @crossplatform 504 * @form 505 * @atomicservice 506 * @since 11 507 */ 508 addColorStop(offset: number, color: string): void; 509} 510 511/** 512 * Path object, which provides basic methods for drawing paths. 513 * 514 * @syscap SystemCapability.ArkUI.ArkUI.Full 515 * @since 8 516 */ 517/** 518 * Path object, which provides basic methods for drawing paths. 519 * 520 * @syscap SystemCapability.ArkUI.ArkUI.Full 521 * @form 522 * @since 9 523 */ 524/** 525 * Path object, which provides basic methods for drawing paths. 526 * 527 * @syscap SystemCapability.ArkUI.ArkUI.Full 528 * @crossplatform 529 * @form 530 * @since 10 531 */ 532/** 533 * Path object, which provides basic methods for drawing paths. 534 * 535 * @syscap SystemCapability.ArkUI.ArkUI.Full 536 * @crossplatform 537 * @form 538 * @atomicservice 539 * @since 11 540 */ 541declare class CanvasPath { 542 /** 543 * Draw an arc path 544 * 545 * @param { number } x - The x-axis coordinate of the center (center of the circle) of the arc. 546 * @param { number } y - The y-axis coordinate of the center (center of the circle) of the arc. 547 * @param { number } radius - Radius of the arc. 548 * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. 549 * @param { number } endAngle - The end point of the arc, in radians. 550 * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, 551 * the arc is drawn clockwise. The default value is false. 552 * @syscap SystemCapability.ArkUI.ArkUI.Full 553 * @since 8 554 */ 555 /** 556 * Draw an arc path 557 * 558 * @param { number } x - The x-axis coordinate of the center (center of the circle) of the arc. 559 * @param { number } y - The y-axis coordinate of the center (center of the circle) of the arc. 560 * @param { number } radius - Radius of the arc. 561 * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. 562 * @param { number } endAngle - The end point of the arc, in radians. 563 * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, 564 * the arc is drawn clockwise. The default value is false. 565 * @syscap SystemCapability.ArkUI.ArkUI.Full 566 * @form 567 * @since 9 568 */ 569 /** 570 * Draw an arc path 571 * 572 * @param { number } x - The x-axis coordinate of the center (center of the circle) of the arc. 573 * @param { number } y - The y-axis coordinate of the center (center of the circle) of the arc. 574 * @param { number } radius - Radius of the arc. 575 * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. 576 * @param { number } endAngle - The end point of the arc, in radians. 577 * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, 578 * the arc is drawn clockwise. The default value is false. 579 * @syscap SystemCapability.ArkUI.ArkUI.Full 580 * @crossplatform 581 * @form 582 * @since 10 583 */ 584 /** 585 * Draw an arc path 586 * 587 * @param { number } x - The x-axis coordinate of the center (center of the circle) of the arc. 588 * @param { number } y - The y-axis coordinate of the center (center of the circle) of the arc. 589 * @param { number } radius - Radius of the arc. 590 * @param { number } startAngle - Start point of an arc, which starts to be calculated in the x-axis direction. The unit is radian. 591 * @param { number } endAngle - The end point of the arc, in radians. 592 * @param { boolean } counterclockwise - If the value is true, the arc is drawn counterclockwise. Otherwise, 593 * the arc is drawn clockwise. The default value is false. 594 * @syscap SystemCapability.ArkUI.ArkUI.Full 595 * @crossplatform 596 * @form 597 * @atomicservice 598 * @since 11 599 */ 600 arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; 601 602 /** 603 * Draw arc paths based on control points and radius 604 * 605 * @param { number } x1 - The x-axis coordinate of the first control point. 606 * @param { number } y1 - The y-axis coordinate of the first control point. 607 * @param { number } x2 - The x-axis coordinate of the second control point. 608 * @param { number } y2 - The y-axis coordinate of the second control point. 609 * @param { number } radius - Radius of the arc. 610 * @syscap SystemCapability.ArkUI.ArkUI.Full 611 * @since 8 612 */ 613 /** 614 * Draw arc paths based on control points and radius 615 * 616 * @param { number } x1 - The x-axis coordinate of the first control point. 617 * @param { number } y1 - The y-axis coordinate of the first control point. 618 * @param { number } x2 - The x-axis coordinate of the second control point. 619 * @param { number } y2 - The y-axis coordinate of the second control point. 620 * @param { number } radius - Radius of the arc. 621 * @syscap SystemCapability.ArkUI.ArkUI.Full 622 * @form 623 * @since 9 624 */ 625 /** 626 * Draw arc paths based on control points and radius 627 * 628 * @param { number } x1 - The x-axis coordinate of the first control point. 629 * @param { number } y1 - The y-axis coordinate of the first control point. 630 * @param { number } x2 - The x-axis coordinate of the second control point. 631 * @param { number } y2 - The y-axis coordinate of the second control point. 632 * @param { number } radius - Radius of the arc. 633 * @syscap SystemCapability.ArkUI.ArkUI.Full 634 * @crossplatform 635 * @form 636 * @since 10 637 */ 638 /** 639 * Draw arc paths based on control points and radius 640 * 641 * @param { number } x1 - The x-axis coordinate of the first control point. 642 * @param { number } y1 - The y-axis coordinate of the first control point. 643 * @param { number } x2 - The x-axis coordinate of the second control point. 644 * @param { number } y2 - The y-axis coordinate of the second control point. 645 * @param { number } radius - Radius of the arc. 646 * @syscap SystemCapability.ArkUI.ArkUI.Full 647 * @crossplatform 648 * @form 649 * @atomicservice 650 * @since 11 651 */ 652 arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; 653 654 /** 655 * Drawing Cubic Bessel Curve Paths 656 * 657 * @param { number } cp1x - The x-axis coordinate of the first control point. 658 * @param { number } cp1y - The y-axis coordinate of the first control point. 659 * @param { number } cp2x - The x-axis coordinate of the second control point. 660 * @param { number } cp2y - The y-axis coordinate of the second control point. 661 * @param { number } x - x-axis coordinate of the end point. 662 * @param { number } y - y-axis coordinate of the end point. 663 * @syscap SystemCapability.ArkUI.ArkUI.Full 664 * @since 8 665 */ 666 /** 667 * Drawing Cubic Bessel Curve Paths 668 * 669 * @param { number } cp1x - The x-axis coordinate of the first control point. 670 * @param { number } cp1y - The y-axis coordinate of the first control point. 671 * @param { number } cp2x - The x-axis coordinate of the second control point. 672 * @param { number } cp2y - The y-axis coordinate of the second control point. 673 * @param { number } x - x-axis coordinate of the end point. 674 * @param { number } y - y-axis coordinate of the end point. 675 * @syscap SystemCapability.ArkUI.ArkUI.Full 676 * @form 677 * @since 9 678 */ 679 /** 680 * Drawing Cubic Bessel Curve Paths 681 * 682 * @param { number } cp1x - The x-axis coordinate of the first control point. 683 * @param { number } cp1y - The y-axis coordinate of the first control point. 684 * @param { number } cp2x - The x-axis coordinate of the second control point. 685 * @param { number } cp2y - The y-axis coordinate of the second control point. 686 * @param { number } x - x-axis coordinate of the end point. 687 * @param { number } y - y-axis coordinate of the end point. 688 * @syscap SystemCapability.ArkUI.ArkUI.Full 689 * @crossplatform 690 * @form 691 * @since 10 692 */ 693 /** 694 * Drawing Cubic Bessel Curve Paths 695 * 696 * @param { number } cp1x - The x-axis coordinate of the first control point. 697 * @param { number } cp1y - The y-axis coordinate of the first control point. 698 * @param { number } cp2x - The x-axis coordinate of the second control point. 699 * @param { number } cp2y - The y-axis coordinate of the second control point. 700 * @param { number } x - x-axis coordinate of the end point. 701 * @param { number } y - y-axis coordinate of the end point. 702 * @syscap SystemCapability.ArkUI.ArkUI.Full 703 * @crossplatform 704 * @form 705 * @atomicservice 706 * @since 11 707 */ 708 bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; 709 710 /** 711 * Returns the pen point to the start point of the current sub-path 712 * 713 * @syscap SystemCapability.ArkUI.ArkUI.Full 714 * @since 8 715 */ 716 /** 717 * Returns the pen point to the start point of the current sub-path 718 * 719 * @syscap SystemCapability.ArkUI.ArkUI.Full 720 * @form 721 * @since 9 722 */ 723 /** 724 * Returns the pen point to the start point of the current sub-path 725 * 726 * @syscap SystemCapability.ArkUI.ArkUI.Full 727 * @crossplatform 728 * @form 729 * @since 10 730 */ 731 /** 732 * Returns the pen point to the start point of the current sub-path 733 * 734 * @syscap SystemCapability.ArkUI.ArkUI.Full 735 * @crossplatform 736 * @form 737 * @atomicservice 738 * @since 11 739 */ 740 closePath(): void; 741 742 /** 743 * Draw an Elliptic Path 744 * 745 * @param { number } x - x-axis coordinate of the center of the ellipse. 746 * @param { number } y - y-axis coordinate of the center of the ellipse. 747 * @param { number } radiusX - Radius of the major axis of the ellipse. 748 * @param { number } radiusY - Radius of the minor axis of the ellipse. 749 * @param { number } rotation - The rotation angle of the ellipse, in radians (not angular degrees). 750 * @param { number } startAngle - The angle of the starting point to be drawn, measured from the x-axis in radians 751 * (not angular degrees). 752 * @param { number } endAngle - The angle, in radians, at which the ellipse is to be drawn (not angular degrees). 753 * @param { boolean } counterclockwise - If the value is true, the ellipse is drawn counterclockwise. Otherwise, 754 * the ellipse is drawn clockwise. The default value is false. 755 * @syscap SystemCapability.ArkUI.ArkUI.Full 756 * @since 8 757 */ 758 /** 759 * Draw an Elliptic Path 760 * 761 * @param { number } x - x-axis coordinate of the center of the ellipse. 762 * @param { number } y - y-axis coordinate of the center of the ellipse. 763 * @param { number } radiusX - Radius of the major axis of the ellipse. 764 * @param { number } radiusY - Radius of the minor axis of the ellipse. 765 * @param { number } rotation - The rotation angle of the ellipse, in radians (not angular degrees). 766 * @param { number } startAngle - The angle of the starting point to be drawn, measured from the x-axis in radians 767 * (not angular degrees). 768 * @param { number } endAngle - The angle, in radians, at which the ellipse is to be drawn (not angular degrees). 769 * @param { boolean } counterclockwise - If the value is true, the ellipse is drawn counterclockwise. Otherwise, 770 * the ellipse is drawn clockwise. The default value is false. 771 * @syscap SystemCapability.ArkUI.ArkUI.Full 772 * @form 773 * @since 9 774 */ 775 /** 776 * Draw an Elliptic Path 777 * 778 * @param { number } x - x-axis coordinate of the center of the ellipse. 779 * @param { number } y - y-axis coordinate of the center of the ellipse. 780 * @param { number } radiusX - Radius of the major axis of the ellipse. 781 * @param { number } radiusY - Radius of the minor axis of the ellipse. 782 * @param { number } rotation - The rotation angle of the ellipse, in radians (not angular degrees). 783 * @param { number } startAngle - The angle of the starting point to be drawn, measured from the x-axis in radians 784 * (not angular degrees). 785 * @param { number } endAngle - The angle, in radians, at which the ellipse is to be drawn (not angular degrees). 786 * @param { boolean } counterclockwise - If the value is true, the ellipse is drawn counterclockwise. Otherwise, 787 * the ellipse is drawn clockwise. The default value is false. 788 * @syscap SystemCapability.ArkUI.ArkUI.Full 789 * @crossplatform 790 * @form 791 * @since 10 792 */ 793 /** 794 * Draw an Elliptic Path 795 * 796 * @param { number } x - x-axis coordinate of the center of the ellipse. 797 * @param { number } y - y-axis coordinate of the center of the ellipse. 798 * @param { number } radiusX - Radius of the major axis of the ellipse. 799 * @param { number } radiusY - Radius of the minor axis of the ellipse. 800 * @param { number } rotation - The rotation angle of the ellipse, in radians (not angular degrees). 801 * @param { number } startAngle - The angle of the starting point to be drawn, measured from the x-axis in radians 802 * (not angular degrees). 803 * @param { number } endAngle - The angle, in radians, at which the ellipse is to be drawn (not angular degrees). 804 * @param { boolean } counterclockwise - If the value is true, the ellipse is drawn counterclockwise. Otherwise, 805 * the ellipse is drawn clockwise. The default value is false. 806 * @syscap SystemCapability.ArkUI.ArkUI.Full 807 * @crossplatform 808 * @form 809 * @atomicservice 810 * @since 11 811 */ 812 ellipse( 813 x: number, 814 y: number, 815 radiusX: number, 816 radiusY: number, 817 rotation: number, 818 startAngle: number, 819 endAngle: number, 820 counterclockwise?: boolean, 821 ): void; 822 823 /** 824 * Connect sub-path using straight lines 825 * 826 * @param { number } x - The x-axis coordinate of the end point of the line. 827 * @param { number } y - The y-axis coordinate of the end point of the line. 828 * @syscap SystemCapability.ArkUI.ArkUI.Full 829 * @since 8 830 */ 831 /** 832 * Connect sub-path using straight lines 833 * 834 * @param { number } x - The x-axis coordinate of the end point of the line. 835 * @param { number } y - The y-axis coordinate of the end point of the line. 836 * @syscap SystemCapability.ArkUI.ArkUI.Full 837 * @form 838 * @since 9 839 */ 840 /** 841 * Connect sub-path using straight lines 842 * 843 * @param { number } x - The x-axis coordinate of the end point of the line. 844 * @param { number } y - The y-axis coordinate of the end point of the line. 845 * @syscap SystemCapability.ArkUI.ArkUI.Full 846 * @crossplatform 847 * @form 848 * @since 10 849 */ 850 /** 851 * Connect sub-path using straight lines 852 * 853 * @param { number } x - The x-axis coordinate of the end point of the line. 854 * @param { number } y - The y-axis coordinate of the end point of the line. 855 * @syscap SystemCapability.ArkUI.ArkUI.Full 856 * @crossplatform 857 * @form 858 * @atomicservice 859 * @since 11 860 */ 861 lineTo(x: number, y: number): void; 862 863 /** 864 * Moves the start point of a new sub-path to the (x, y) coordinate. 865 * 866 * @param { number } x - The x-axis coordinate of the point. 867 * @param { number } y - The y-axis coordinate of the point. 868 * @syscap SystemCapability.ArkUI.ArkUI.Full 869 * @since 8 870 */ 871 /** 872 * Moves the start point of a new sub-path to the (x, y) coordinate. 873 * 874 * @param { number } x - The x-axis coordinate of the point. 875 * @param { number } y - The y-axis coordinate of the point. 876 * @syscap SystemCapability.ArkUI.ArkUI.Full 877 * @form 878 * @since 9 879 */ 880 /** 881 * Moves the start point of a new sub-path to the (x, y) coordinate. 882 * 883 * @param { number } x - The x-axis coordinate of the point. 884 * @param { number } y - The y-axis coordinate of the point. 885 * @syscap SystemCapability.ArkUI.ArkUI.Full 886 * @crossplatform 887 * @form 888 * @since 10 889 */ 890 /** 891 * Moves the start point of a new sub-path to the (x, y) coordinate. 892 * 893 * @param { number } x - The x-axis coordinate of the point. 894 * @param { number } y - The y-axis coordinate of the point. 895 * @syscap SystemCapability.ArkUI.ArkUI.Full 896 * @crossplatform 897 * @form 898 * @atomicservice 899 * @since 11 900 */ 901 moveTo(x: number, y: number): void; 902 903 /** 904 * Draw quadratic Bezier curve paths 905 * 906 * @param { number } cpx - The x-axis coordinate of the control point. 907 * @param { number } cpy - The y-axis coordinate of the control point. 908 * @param { number } x - x-axis coordinate of the end point. 909 * @param { number } y - y-axis coordinate of the end point. 910 * @syscap SystemCapability.ArkUI.ArkUI.Full 911 * @since 8 912 */ 913 /** 914 * Draw quadratic Bezier curve paths 915 * 916 * @param { number } cpx - The x-axis coordinate of the control point. 917 * @param { number } cpy - The y-axis coordinate of the control point. 918 * @param { number } x - x-axis coordinate of the end point. 919 * @param { number } y - y-axis coordinate of the end point. 920 * @syscap SystemCapability.ArkUI.ArkUI.Full 921 * @form 922 * @since 9 923 */ 924 /** 925 * Draw quadratic Bezier curve paths 926 * 927 * @param { number } cpx - The x-axis coordinate of the control point. 928 * @param { number } cpy - The y-axis coordinate of the control point. 929 * @param { number } x - x-axis coordinate of the end point. 930 * @param { number } y - y-axis coordinate of the end point. 931 * @syscap SystemCapability.ArkUI.ArkUI.Full 932 * @crossplatform 933 * @form 934 * @since 10 935 */ 936 /** 937 * Draw quadratic Bezier curve paths 938 * 939 * @param { number } cpx - The x-axis coordinate of the control point. 940 * @param { number } cpy - The y-axis coordinate of the control point. 941 * @param { number } x - x-axis coordinate of the end point. 942 * @param { number } y - y-axis coordinate of the end point. 943 * @syscap SystemCapability.ArkUI.ArkUI.Full 944 * @crossplatform 945 * @form 946 * @atomicservice 947 * @since 11 948 */ 949 quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; 950 951 /** 952 * Draw Rectangular Paths 953 * 954 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 955 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 956 * @param { number } w - Width of the rectangle. 957 * @param { number } h - Height of the rectangle. 958 * @syscap SystemCapability.ArkUI.ArkUI.Full 959 * @since 8 960 */ 961 /** 962 * Draw Rectangular Paths 963 * 964 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 965 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 966 * @param { number } w - Width of the rectangle. 967 * @param { number } h - Height of the rectangle. 968 * @syscap SystemCapability.ArkUI.ArkUI.Full 969 * @form 970 * @since 9 971 */ 972 /** 973 * Draw Rectangular Paths 974 * 975 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 976 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 977 * @param { number } w - Width of the rectangle. 978 * @param { number } h - Height of the rectangle. 979 * @syscap SystemCapability.ArkUI.ArkUI.Full 980 * @crossplatform 981 * @form 982 * @since 10 983 */ 984 /** 985 * Draw Rectangular Paths 986 * 987 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 988 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 989 * @param { number } w - Width of the rectangle. 990 * @param { number } h - Height of the rectangle. 991 * @syscap SystemCapability.ArkUI.ArkUI.Full 992 * @crossplatform 993 * @form 994 * @atomicservice 995 * @since 11 996 */ 997 rect(x: number, y: number, w: number, h: number): void; 998} 999 1000/** 1001 * 2D path object for path drawing 1002 * 1003 * @extends CanvasPath 1004 * @syscap SystemCapability.ArkUI.ArkUI.Full 1005 * @since 8 1006 */ 1007/** 1008 * 2D path object for path drawing 1009 * 1010 * @extends CanvasPath 1011 * @syscap SystemCapability.ArkUI.ArkUI.Full 1012 * @form 1013 * @since 9 1014 */ 1015/** 1016 * 2D path object for path drawing 1017 * 1018 * @extends CanvasPath 1019 * @syscap SystemCapability.ArkUI.ArkUI.Full 1020 * @crossplatform 1021 * @form 1022 * @since 10 1023 */ 1024/** 1025 * 2D path object for path drawing 1026 * 1027 * @extends CanvasPath 1028 * @syscap SystemCapability.ArkUI.ArkUI.Full 1029 * @crossplatform 1030 * @form 1031 * @atomicservice 1032 * @since 11 1033 */ 1034declare class Path2D extends CanvasPath { 1035 /** 1036 * Adds a path according to the specified path variable. 1037 * 1038 * @param { Path2D } path - Indicates the path object to be added. 1039 * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. 1040 * @syscap SystemCapability.ArkUI.ArkUI.Full 1041 * @since 8 1042 */ 1043 /** 1044 * Adds a path according to the specified path variable. 1045 * 1046 * @param { Path2D } path - Indicates the path object to be added. 1047 * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. 1048 * @syscap SystemCapability.ArkUI.ArkUI.Full 1049 * @form 1050 * @since 9 1051 */ 1052 /** 1053 * Adds a path according to the specified path variable. 1054 * 1055 * @param { Path2D } path - Indicates the path object to be added. 1056 * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. 1057 * @syscap SystemCapability.ArkUI.ArkUI.Full 1058 * @crossplatform 1059 * @form 1060 * @since 10 1061 */ 1062 /** 1063 * Adds a path according to the specified path variable. 1064 * 1065 * @param { Path2D } path - Indicates the path object to be added. 1066 * @param { Matrix2D } transform - Transformation matrix of the new trail. The default value is null. 1067 * @syscap SystemCapability.ArkUI.ArkUI.Full 1068 * @crossplatform 1069 * @form 1070 * @atomicservice 1071 * @since 11 1072 */ 1073 addPath(path: Path2D, transform?: Matrix2D): void; 1074 1075 /** 1076 * Create an empty path object. 1077 * 1078 * @syscap SystemCapability.ArkUI.ArkUI.Full 1079 * @since 8 1080 */ 1081 /** 1082 * Create an empty path object. 1083 * 1084 * @syscap SystemCapability.ArkUI.ArkUI.Full 1085 * @form 1086 * @since 9 1087 */ 1088 /** 1089 * Create an empty path object. 1090 * 1091 * @syscap SystemCapability.ArkUI.ArkUI.Full 1092 * @crossplatform 1093 * @form 1094 * @since 10 1095 */ 1096 /** 1097 * Create an empty path object. 1098 * 1099 * @syscap SystemCapability.ArkUI.ArkUI.Full 1100 * @crossplatform 1101 * @form 1102 * @atomicservice 1103 * @since 11 1104 */ 1105 constructor(); 1106 1107 /** 1108 * Create an empty path object. 1109 * 1110 * @param { LengthMetricsUnit } [unit] - the unit mode 1111 * @syscap SystemCapability.ArkUI.ArkUI.Full 1112 * @crossplatform 1113 * @form 1114 * @atomicservice 1115 * @since 12 1116 */ 1117 constructor(unit: LengthMetricsUnit); 1118 1119 /** 1120 * Create a copy of a path object 1121 * 1122 * @param { Path2D } path - Path object to be copied 1123 * @syscap SystemCapability.ArkUI.ArkUI.Full 1124 * @since 8 1125 */ 1126 /** 1127 * Create a copy of a path object 1128 * 1129 * @param { Path2D } path - Path object to be copied 1130 * @syscap SystemCapability.ArkUI.ArkUI.Full 1131 * @form 1132 * @since 9 1133 */ 1134 /** 1135 * Create a copy of a path object 1136 * 1137 * @param { Path2D } path - Path object to be copied 1138 * @syscap SystemCapability.ArkUI.ArkUI.Full 1139 * @crossplatform 1140 * @form 1141 * @since 10 1142 */ 1143 /** 1144 * Create a copy of a path object 1145 * 1146 * @param { Path2D } path - Path object to be copied 1147 * @syscap SystemCapability.ArkUI.ArkUI.Full 1148 * @crossplatform 1149 * @form 1150 * @atomicservice 1151 * @since 11 1152 */ 1153 constructor(path: Path2D); 1154 1155 /** 1156 * Create a copy of a path object 1157 * 1158 * @param { Path2D } path - Path object to be copied 1159 * @param { LengthMetricsUnit } [unit] - the unit mode 1160 * @syscap SystemCapability.ArkUI.ArkUI.Full 1161 * @crossplatform 1162 * @form 1163 * @atomicservice 1164 * @since 12 1165 */ 1166 constructor(path: Path2D, unit: LengthMetricsUnit); 1167 1168 /** 1169 * Create a new path according to the description. 1170 * 1171 * @param { string } d - Indicates the path string that compiles with the SVG path description specifications. 1172 * @syscap SystemCapability.ArkUI.ArkUI.Full 1173 * @since 8 1174 */ 1175 /** 1176 * Create a new path according to the description. 1177 * 1178 * @param { string } d - Indicates the path string that compiles with the SVG path description specifications. 1179 * @syscap SystemCapability.ArkUI.ArkUI.Full 1180 * @form 1181 * @since 9 1182 */ 1183 /** 1184 * Create a new path according to the description. 1185 * 1186 * @param { string } d - Indicates the path string that compiles with the SVG path description specifications. 1187 * @syscap SystemCapability.ArkUI.ArkUI.Full 1188 * @crossplatform 1189 * @form 1190 * @since 10 1191 */ 1192 /** 1193 * Create a new path according to the description. 1194 * 1195 * @param { string } d - Indicates the path string that compiles with the SVG path description specifications. 1196 * @syscap SystemCapability.ArkUI.ArkUI.Full 1197 * @crossplatform 1198 * @form 1199 * @atomicservice 1200 * @since 11 1201 */ 1202 constructor(d: string); 1203 1204 /** 1205 * Create a new path according to the description. 1206 * 1207 * @param { string } description - Indicates the path string that compiles with the SVG path description specifications. 1208 * @param { LengthMetricsUnit } [unit] - the unit mode 1209 * @syscap SystemCapability.ArkUI.ArkUI.Full 1210 * @crossplatform 1211 * @form 1212 * @atomicservice 1213 * @since 12 1214 */ 1215 constructor(description: string, unit: LengthMetricsUnit); 1216} 1217 1218/** 1219 * Describes an opaque object of a template, which is created using the createPattern() method. 1220 * 1221 * @interface CanvasPattern 1222 * @syscap SystemCapability.ArkUI.ArkUI.Full 1223 * @since 8 1224 */ 1225/** 1226 * Describes an opaque object of a template, which is created using the createPattern() method. 1227 * 1228 * @interface CanvasPattern 1229 * @syscap SystemCapability.ArkUI.ArkUI.Full 1230 * @form 1231 * @since 9 1232 */ 1233/** 1234 * Describes an opaque object of a template, which is created using the createPattern() method. 1235 * 1236 * @interface CanvasPattern 1237 * @syscap SystemCapability.ArkUI.ArkUI.Full 1238 * @crossplatform 1239 * @form 1240 * @since 10 1241 */ 1242/** 1243 * Describes an opaque object of a template, which is created using the createPattern() method. 1244 * 1245 * @interface CanvasPattern 1246 * @syscap SystemCapability.ArkUI.ArkUI.Full 1247 * @crossplatform 1248 * @form 1249 * @atomicservice 1250 * @since 11 1251 */ 1252declare interface CanvasPattern { 1253 /** 1254 * Adds the matrix transformation effect to the current template. 1255 * 1256 * @param { Matrix2D } transform - transformation matrix. The default value is null. 1257 * @syscap SystemCapability.ArkUI.ArkUI.Full 1258 * @since 8 1259 */ 1260 /** 1261 * Adds the matrix transformation effect to the current template. 1262 * 1263 * @param { Matrix2D } transform - transformation matrix. The default value is null. 1264 * @syscap SystemCapability.ArkUI.ArkUI.Full 1265 * @form 1266 * @since 9 1267 */ 1268 /** 1269 * Adds the matrix transformation effect to the current template. 1270 * 1271 * @param { Matrix2D } transform - transformation matrix. The default value is null. 1272 * @syscap SystemCapability.ArkUI.ArkUI.Full 1273 * @crossplatform 1274 * @form 1275 * @since 10 1276 */ 1277 /** 1278 * Adds the matrix transformation effect to the current template. 1279 * 1280 * @param { Matrix2D } transform - transformation matrix. The default value is null. 1281 * @syscap SystemCapability.ArkUI.ArkUI.Full 1282 * @crossplatform 1283 * @form 1284 * @atomicservice 1285 * @since 11 1286 */ 1287 setTransform(transform?: Matrix2D): void; 1288} 1289 1290/** 1291 * Size information of the text 1292 * 1293 * @interface TextMetrics 1294 * @syscap SystemCapability.ArkUI.ArkUI.Full 1295 * @since 8 1296 */ 1297/** 1298 * Size information of the text 1299 * 1300 * @interface TextMetrics 1301 * @syscap SystemCapability.ArkUI.ArkUI.Full 1302 * @form 1303 * @since 9 1304 */ 1305/** 1306 * Size information of the text 1307 * 1308 * @interface TextMetrics 1309 * @syscap SystemCapability.ArkUI.ArkUI.Full 1310 * @crossplatform 1311 * @form 1312 * @since 10 1313 */ 1314/** 1315 * Size information of the text 1316 * 1317 * @interface TextMetrics 1318 * @syscap SystemCapability.ArkUI.ArkUI.Full 1319 * @crossplatform 1320 * @form 1321 * @atomicservice 1322 * @since 11 1323 */ 1324declare interface TextMetrics { 1325 /** 1326 * Double, the distance from the horizontal line indicated by the textBaseline property to the top of 1327 * the rectangular boundary of the rendered text. 1328 * 1329 * @type { number } 1330 * @readonly 1331 * @syscap SystemCapability.ArkUI.ArkUI.Full 1332 * @since 8 1333 */ 1334 /** 1335 * Double, the distance from the horizontal line indicated by the textBaseline property to the top of 1336 * the rectangular boundary of the rendered text. 1337 * 1338 * @type { number } 1339 * @readonly 1340 * @syscap SystemCapability.ArkUI.ArkUI.Full 1341 * @form 1342 * @since 9 1343 */ 1344 /** 1345 * Double, the distance from the horizontal line indicated by the textBaseline property to the top of 1346 * the rectangular boundary of the rendered text. 1347 * 1348 * @type { number } 1349 * @readonly 1350 * @syscap SystemCapability.ArkUI.ArkUI.Full 1351 * @crossplatform 1352 * @form 1353 * @since 10 1354 */ 1355 /** 1356 * Double, the distance from the horizontal line indicated by the textBaseline property to the top of 1357 * the rectangular boundary of the rendered text. 1358 * 1359 * @type { number } 1360 * @readonly 1361 * @syscap SystemCapability.ArkUI.ArkUI.Full 1362 * @crossplatform 1363 * @form 1364 * @atomicservice 1365 * @since 11 1366 */ 1367 readonly actualBoundingBoxAscent: number; 1368 1369 /** 1370 * Double, the distance from the horizontal line indicated by the textBaseline property to the bottom of 1371 * the rectangular boundary of the rendered text. 1372 * 1373 * @type { number } 1374 * @readonly 1375 * @syscap SystemCapability.ArkUI.ArkUI.Full 1376 * @since 8 1377 */ 1378 /** 1379 * Double, the distance from the horizontal line indicated by the textBaseline property to the bottom of 1380 * the rectangular boundary of the rendered text. 1381 * 1382 * @type { number } 1383 * @readonly 1384 * @syscap SystemCapability.ArkUI.ArkUI.Full 1385 * @form 1386 * @since 9 1387 */ 1388 /** 1389 * Double, the distance from the horizontal line indicated by the textBaseline property to the bottom of 1390 * the rectangular boundary of the rendered text. 1391 * 1392 * @type { number } 1393 * @readonly 1394 * @syscap SystemCapability.ArkUI.ArkUI.Full 1395 * @crossplatform 1396 * @form 1397 * @since 10 1398 */ 1399 /** 1400 * Double, the distance from the horizontal line indicated by the textBaseline property to the bottom of 1401 * the rectangular boundary of the rendered text. 1402 * 1403 * @type { number } 1404 * @readonly 1405 * @syscap SystemCapability.ArkUI.ArkUI.Full 1406 * @crossplatform 1407 * @form 1408 * @atomicservice 1409 * @since 11 1410 */ 1411 readonly actualBoundingBoxDescent: number; 1412 1413 /** 1414 * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to 1415 * the left of the text rectangle boundary. 1416 * 1417 * @type { number } 1418 * @readonly 1419 * @syscap SystemCapability.ArkUI.ArkUI.Full 1420 * @since 8 1421 */ 1422 /** 1423 * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to 1424 * the left of the text rectangle boundary. 1425 * 1426 * @type { number } 1427 * @readonly 1428 * @syscap SystemCapability.ArkUI.ArkUI.Full 1429 * @form 1430 * @since 9 1431 */ 1432 /** 1433 * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to 1434 * the left of the text rectangle boundary. 1435 * 1436 * @type { number } 1437 * @readonly 1438 * @syscap SystemCapability.ArkUI.ArkUI.Full 1439 * @crossplatform 1440 * @form 1441 * @since 10 1442 */ 1443 /** 1444 * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to 1445 * the left of the text rectangle boundary. 1446 * 1447 * @type { number } 1448 * @readonly 1449 * @syscap SystemCapability.ArkUI.ArkUI.Full 1450 * @crossplatform 1451 * @form 1452 * @atomicservice 1453 * @since 11 1454 */ 1455 readonly actualBoundingBoxLeft: number; 1456 1457 /** 1458 * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to 1459 * the right of the text rectangle boundary. 1460 * 1461 * @type { number } 1462 * @readonly 1463 * @syscap SystemCapability.ArkUI.ArkUI.Full 1464 * @since 8 1465 */ 1466 /** 1467 * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to 1468 * the right of the text rectangle boundary. 1469 * 1470 * @type { number } 1471 * @readonly 1472 * @syscap SystemCapability.ArkUI.ArkUI.Full 1473 * @form 1474 * @since 9 1475 */ 1476 /** 1477 * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to 1478 * the right of the text rectangle boundary. 1479 * 1480 * @type { number } 1481 * @readonly 1482 * @syscap SystemCapability.ArkUI.ArkUI.Full 1483 * @crossplatform 1484 * @form 1485 * @since 10 1486 */ 1487 /** 1488 * Double, parallel to the baseline, distance from the alignment point determined by the textAlign property to 1489 * the right of the text rectangle boundary. 1490 * 1491 * @type { number } 1492 * @readonly 1493 * @syscap SystemCapability.ArkUI.ArkUI.Full 1494 * @crossplatform 1495 * @form 1496 * @atomicservice 1497 * @since 11 1498 */ 1499 readonly actualBoundingBoxRight: number; 1500 1501 /** 1502 * Double, the distance from the horizontal line indicated by the textBaseline property to the alphabetic baseline of 1503 * the wireframe. 1504 * 1505 * @type { number } 1506 * @readonly 1507 * @syscap SystemCapability.ArkUI.ArkUI.Full 1508 * @since 8 1509 */ 1510 /** 1511 * Double, the distance from the horizontal line indicated by the textBaseline property to the alphabetic baseline of 1512 * the wireframe. 1513 * 1514 * @type { number } 1515 * @readonly 1516 * @syscap SystemCapability.ArkUI.ArkUI.Full 1517 * @form 1518 * @since 9 1519 */ 1520 /** 1521 * Double, the distance from the horizontal line indicated by the textBaseline property to the alphabetic baseline of 1522 * the wireframe. 1523 * 1524 * @type { number } 1525 * @readonly 1526 * @syscap SystemCapability.ArkUI.ArkUI.Full 1527 * @crossplatform 1528 * @form 1529 * @since 10 1530 */ 1531 /** 1532 * Double, the distance from the horizontal line indicated by the textBaseline property to the alphabetic baseline of 1533 * the wireframe. 1534 * 1535 * @type { number } 1536 * @readonly 1537 * @syscap SystemCapability.ArkUI.ArkUI.Full 1538 * @crossplatform 1539 * @form 1540 * @atomicservice 1541 * @since 11 1542 */ 1543 readonly alphabeticBaseline: number; 1544 1545 /** 1546 * Double, the distance from the horizontal line indicated by the textBaseline property to the top of the 1547 * em square in the wireframe. 1548 * 1549 * @type { number } 1550 * @readonly 1551 * @syscap SystemCapability.ArkUI.ArkUI.Full 1552 * @since 8 1553 */ 1554 /** 1555 * Double, the distance from the horizontal line indicated by the textBaseline property to the top of the 1556 * em square in the wireframe. 1557 * 1558 * @type { number } 1559 * @readonly 1560 * @syscap SystemCapability.ArkUI.ArkUI.Full 1561 * @form 1562 * @since 9 1563 */ 1564 /** 1565 * Double, the distance from the horizontal line indicated by the textBaseline property to the top of the 1566 * em square in the wireframe. 1567 * 1568 * @type { number } 1569 * @readonly 1570 * @syscap SystemCapability.ArkUI.ArkUI.Full 1571 * @crossplatform 1572 * @form 1573 * @since 10 1574 */ 1575 /** 1576 * Double, the distance from the horizontal line indicated by the textBaseline property to the top of the 1577 * em square in the wireframe. 1578 * 1579 * @type { number } 1580 * @readonly 1581 * @syscap SystemCapability.ArkUI.ArkUI.Full 1582 * @crossplatform 1583 * @form 1584 * @atomicservice 1585 * @since 11 1586 */ 1587 readonly emHeightAscent: number; 1588 1589 /** 1590 * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the 1591 * em box in the wireframe. 1592 * 1593 * @type { number } 1594 * @readonly 1595 * @syscap SystemCapability.ArkUI.ArkUI.Full 1596 * @since 8 1597 */ 1598 /** 1599 * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the 1600 * em box in the wireframe. 1601 * 1602 * @type { number } 1603 * @readonly 1604 * @syscap SystemCapability.ArkUI.ArkUI.Full 1605 * @form 1606 * @since 9 1607 */ 1608 /** 1609 * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the 1610 * em box in the wireframe. 1611 * 1612 * @type { number } 1613 * @readonly 1614 * @syscap SystemCapability.ArkUI.ArkUI.Full 1615 * @crossplatform 1616 * @form 1617 * @since 10 1618 */ 1619 /** 1620 * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the 1621 * em box in the wireframe. 1622 * 1623 * @type { number } 1624 * @readonly 1625 * @syscap SystemCapability.ArkUI.ArkUI.Full 1626 * @crossplatform 1627 * @form 1628 * @atomicservice 1629 * @since 11 1630 */ 1631 readonly emHeightDescent: number; 1632 1633 /** 1634 * Double, distance from the horizontal line indicated by the textBaseline property to the top of the 1635 * highest rectangle boundary of all fonts rendering text. 1636 * 1637 * @type { number } 1638 * @readonly 1639 * @syscap SystemCapability.ArkUI.ArkUI.Full 1640 * @since 8 1641 */ 1642 /** 1643 * Double, distance from the horizontal line indicated by the textBaseline property to the top of the 1644 * highest rectangle boundary of all fonts rendering text. 1645 * 1646 * @type { number } 1647 * @readonly 1648 * @syscap SystemCapability.ArkUI.ArkUI.Full 1649 * @form 1650 * @since 9 1651 */ 1652 /** 1653 * Double, distance from the horizontal line indicated by the textBaseline property to the top of the 1654 * highest rectangle boundary of all fonts rendering text. 1655 * 1656 * @type { number } 1657 * @readonly 1658 * @syscap SystemCapability.ArkUI.ArkUI.Full 1659 * @crossplatform 1660 * @form 1661 * @since 10 1662 */ 1663 /** 1664 * Double, distance from the horizontal line indicated by the textBaseline property to the top of the 1665 * highest rectangle boundary of all fonts rendering text. 1666 * 1667 * @type { number } 1668 * @readonly 1669 * @syscap SystemCapability.ArkUI.ArkUI.Full 1670 * @crossplatform 1671 * @form 1672 * @atomicservice 1673 * @since 11 1674 */ 1675 readonly fontBoundingBoxAscent: number; 1676 1677 /** 1678 * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the 1679 * rectangular boundary of all fonts rendering text. 1680 * 1681 * @type { number } 1682 * @readonly 1683 * @syscap SystemCapability.ArkUI.ArkUI.Full 1684 * @since 8 1685 */ 1686 /** 1687 * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the 1688 * rectangular boundary of all fonts rendering text. 1689 * 1690 * @type { number } 1691 * @readonly 1692 * @syscap SystemCapability.ArkUI.ArkUI.Full 1693 * @form 1694 * @since 9 1695 */ 1696 /** 1697 * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the 1698 * rectangular boundary of all fonts rendering text. 1699 * 1700 * @type { number } 1701 * @readonly 1702 * @syscap SystemCapability.ArkUI.ArkUI.Full 1703 * @crossplatform 1704 * @form 1705 * @since 10 1706 */ 1707 /** 1708 * Double, distance from the horizontal line indicated by the textBaseline property to the bottom of the 1709 * rectangular boundary of all fonts rendering text. 1710 * 1711 * @type { number } 1712 * @readonly 1713 * @syscap SystemCapability.ArkUI.ArkUI.Full 1714 * @crossplatform 1715 * @form 1716 * @atomicservice 1717 * @since 11 1718 */ 1719 readonly fontBoundingBoxDescent: number; 1720 1721 /** 1722 * Double, distance from the horizontal line indicated by the textBaseline property to 1723 * the hanging baseline of the wireframe. 1724 * 1725 * @type { number } 1726 * @readonly 1727 * @syscap SystemCapability.ArkUI.ArkUI.Full 1728 * @since 8 1729 */ 1730 /** 1731 * Double, distance from the horizontal line indicated by the textBaseline property to 1732 * the hanging baseline of the wireframe. 1733 * 1734 * @type { number } 1735 * @readonly 1736 * @syscap SystemCapability.ArkUI.ArkUI.Full 1737 * @form 1738 * @since 9 1739 */ 1740 /** 1741 * Double, distance from the horizontal line indicated by the textBaseline property to 1742 * the hanging baseline of the wireframe. 1743 * 1744 * @type { number } 1745 * @readonly 1746 * @syscap SystemCapability.ArkUI.ArkUI.Full 1747 * @crossplatform 1748 * @form 1749 * @since 10 1750 */ 1751 /** 1752 * Double, distance from the horizontal line indicated by the textBaseline property to 1753 * the hanging baseline of the wireframe. 1754 * 1755 * @type { number } 1756 * @readonly 1757 * @syscap SystemCapability.ArkUI.ArkUI.Full 1758 * @crossplatform 1759 * @form 1760 * @atomicservice 1761 * @since 11 1762 */ 1763 readonly hangingBaseline: number; 1764 1765 /** 1766 * Double, distance from the horizontal line indicated by the textBaseline property to 1767 * the ideographic baseline of the wireframe. 1768 * 1769 * @type { number } 1770 * @readonly 1771 * @syscap SystemCapability.ArkUI.ArkUI.Full 1772 * @since 8 1773 */ 1774 /** 1775 * Double, distance from the horizontal line indicated by the textBaseline property to 1776 * the ideographic baseline of the wireframe. 1777 * 1778 * @type { number } 1779 * @readonly 1780 * @syscap SystemCapability.ArkUI.ArkUI.Full 1781 * @form 1782 * @since 9 1783 */ 1784 /** 1785 * Double, distance from the horizontal line indicated by the textBaseline property to 1786 * the ideographic baseline of the wireframe. 1787 * 1788 * @type { number } 1789 * @readonly 1790 * @syscap SystemCapability.ArkUI.ArkUI.Full 1791 * @crossplatform 1792 * @form 1793 * @since 10 1794 */ 1795 /** 1796 * Double, distance from the horizontal line indicated by the textBaseline property to 1797 * the ideographic baseline of the wireframe. 1798 * 1799 * @type { number } 1800 * @readonly 1801 * @syscap SystemCapability.ArkUI.ArkUI.Full 1802 * @crossplatform 1803 * @form 1804 * @atomicservice 1805 * @since 11 1806 */ 1807 readonly ideographicBaseline: number; 1808 1809 /** 1810 * Indicates the width of a character string. The value is of the double type. 1811 * 1812 * @type { number } 1813 * @readonly 1814 * @syscap SystemCapability.ArkUI.ArkUI.Full 1815 * @since 8 1816 */ 1817 /** 1818 * Indicates the width of a character string. The value is of the double type. 1819 * 1820 * @type { number } 1821 * @readonly 1822 * @syscap SystemCapability.ArkUI.ArkUI.Full 1823 * @form 1824 * @since 9 1825 */ 1826 /** 1827 * Indicates the width of a character string. The value is of the double type. 1828 * 1829 * @type { number } 1830 * @readonly 1831 * @syscap SystemCapability.ArkUI.ArkUI.Full 1832 * @crossplatform 1833 * @form 1834 * @since 10 1835 */ 1836 /** 1837 * Indicates the width of a character string. The value is of the double type. 1838 * 1839 * @type { number } 1840 * @readonly 1841 * @syscap SystemCapability.ArkUI.ArkUI.Full 1842 * @crossplatform 1843 * @form 1844 * @atomicservice 1845 * @since 11 1846 */ 1847 readonly width: number; 1848 1849 /** 1850 * Indicates the height of a character string. The value is of the double type. 1851 * 1852 * @type { number } 1853 * @readonly 1854 * @syscap SystemCapability.ArkUI.ArkUI.Full 1855 * @since 8 1856 */ 1857 /** 1858 * Indicates the height of a character string. The value is of the double type. 1859 * 1860 * @type { number } 1861 * @readonly 1862 * @syscap SystemCapability.ArkUI.ArkUI.Full 1863 * @form 1864 * @since 9 1865 */ 1866 /** 1867 * Indicates the height of a character string. The value is of the double type. 1868 * 1869 * @type { number } 1870 * @readonly 1871 * @syscap SystemCapability.ArkUI.ArkUI.Full 1872 * @crossplatform 1873 * @form 1874 * @since 10 1875 */ 1876 /** 1877 * Indicates the height of a character string. The value is of the double type. 1878 * 1879 * @type { number } 1880 * @readonly 1881 * @syscap SystemCapability.ArkUI.ArkUI.Full 1882 * @crossplatform 1883 * @form 1884 * @atomicservice 1885 * @since 11 1886 */ 1887 readonly height: number; 1888} 1889 1890/** 1891 * Bitmap image object that can be drawn onto the current Canvas 1892 * 1893 * @syscap SystemCapability.ArkUI.ArkUI.Full 1894 * @since 8 1895 */ 1896/** 1897 * Bitmap image object that can be drawn onto the current Canvas 1898 * 1899 * @syscap SystemCapability.ArkUI.ArkUI.Full 1900 * @form 1901 * @since 9 1902 */ 1903/** 1904 * Bitmap image object that can be drawn onto the current Canvas 1905 * 1906 * @syscap SystemCapability.ArkUI.ArkUI.Full 1907 * @crossplatform 1908 * @form 1909 * @since 10 1910 */ 1911/** 1912 * Bitmap image object that can be drawn onto the current Canvas 1913 * 1914 * @syscap SystemCapability.ArkUI.ArkUI.Full 1915 * @crossplatform 1916 * @form 1917 * @atomicservice 1918 * @since 11 1919 */ 1920declare class ImageBitmap { 1921 /** 1922 * Indicates the height of the CSS pixel unit of ImageData. 1923 * 1924 * @type { number } 1925 * @readonly 1926 * @syscap SystemCapability.ArkUI.ArkUI.Full 1927 * @since 8 1928 */ 1929 /** 1930 * Indicates the height of the CSS pixel unit of ImageData. 1931 * 1932 * @type { number } 1933 * @readonly 1934 * @syscap SystemCapability.ArkUI.ArkUI.Full 1935 * @form 1936 * @since 9 1937 */ 1938 /** 1939 * Indicates the height of the CSS pixel unit of ImageData. 1940 * 1941 * @type { number } 1942 * @readonly 1943 * @syscap SystemCapability.ArkUI.ArkUI.Full 1944 * @crossplatform 1945 * @form 1946 * @since 10 1947 */ 1948 /** 1949 * Indicates the height of the CSS pixel unit of ImageData. 1950 * 1951 * @type { number } 1952 * @readonly 1953 * @syscap SystemCapability.ArkUI.ArkUI.Full 1954 * @crossplatform 1955 * @form 1956 * @atomicservice 1957 * @since 11 1958 */ 1959 readonly height: number; 1960 1961 /** 1962 * Indicates the width of the CSS pixel unit of ImageData. 1963 * 1964 * @type { number } 1965 * @readonly 1966 * @syscap SystemCapability.ArkUI.ArkUI.Full 1967 * @since 8 1968 */ 1969 /** 1970 * Indicates the width of the CSS pixel unit of ImageData. 1971 * 1972 * @type { number } 1973 * @readonly 1974 * @syscap SystemCapability.ArkUI.ArkUI.Full 1975 * @form 1976 * @since 9 1977 */ 1978 /** 1979 * Indicates the width of the CSS pixel unit of ImageData. 1980 * 1981 * @type { number } 1982 * @readonly 1983 * @syscap SystemCapability.ArkUI.ArkUI.Full 1984 * @crossplatform 1985 * @form 1986 * @since 10 1987 */ 1988 /** 1989 * Indicates the width of the CSS pixel unit of ImageData. 1990 * 1991 * @type { number } 1992 * @readonly 1993 * @syscap SystemCapability.ArkUI.ArkUI.Full 1994 * @crossplatform 1995 * @form 1996 * @atomicservice 1997 * @since 11 1998 */ 1999 readonly width: number; 2000 2001 /** 2002 * Releases all graphics resources associated with an ImageBitmap. 2003 * 2004 * @syscap SystemCapability.ArkUI.ArkUI.Full 2005 * @since 8 2006 */ 2007 /** 2008 * Releases all graphics resources associated with an ImageBitmap. 2009 * 2010 * @syscap SystemCapability.ArkUI.ArkUI.Full 2011 * @form 2012 * @since 9 2013 */ 2014 /** 2015 * Releases all graphics resources associated with an ImageBitmap. 2016 * 2017 * @syscap SystemCapability.ArkUI.ArkUI.Full 2018 * @crossplatform 2019 * @form 2020 * @since 10 2021 */ 2022 /** 2023 * Releases all graphics resources associated with an ImageBitmap. 2024 * 2025 * @syscap SystemCapability.ArkUI.ArkUI.Full 2026 * @crossplatform 2027 * @form 2028 * @atomicservice 2029 * @since 11 2030 */ 2031 close(): void; 2032 2033 /** 2034 * Create an ImageBitmap object based on the transferred image path. 2035 * 2036 * @param { string } src - Path of the image object. 2037 * @syscap SystemCapability.ArkUI.ArkUI.Full 2038 * @since 8 2039 */ 2040 /** 2041 * Create an ImageBitmap object based on the transferred image path. 2042 * 2043 * @param { string } src - Path of the image object. 2044 * @syscap SystemCapability.ArkUI.ArkUI.Full 2045 * @form 2046 * @since 9 2047 */ 2048 /** 2049 * Create an ImageBitmap object based on the transferred image path. 2050 * 2051 * @param { string } src - Path of the image object. 2052 * @syscap SystemCapability.ArkUI.ArkUI.Full 2053 * @crossplatform 2054 * @form 2055 * @since 10 2056 */ 2057 /** 2058 * Create an ImageBitmap object based on the transferred image path. 2059 * 2060 * @param { string } src - Path of the image object. 2061 * @syscap SystemCapability.ArkUI.ArkUI.Full 2062 * @crossplatform 2063 * @form 2064 * @atomicservice 2065 * @since 11 2066 */ 2067 constructor(src: string); 2068 2069 /** 2070 * Create an ImageBitmap object based on the transferred image path. 2071 * 2072 * @param { string } src - Path of the image object. 2073 * @param { LengthMetricsUnit } [unit] - the unit mode 2074 * @syscap SystemCapability.ArkUI.ArkUI.Full 2075 * @crossplatform 2076 * @form 2077 * @atomicservice 2078 * @since 12 2079 */ 2080 constructor(src: string, unit: LengthMetricsUnit); 2081 2082 /** 2083 * Transfer a PixelMap object to construct an ImageBitmap object. 2084 * 2085 * @param { PixelMap } data - PixelMap object 2086 * @syscap SystemCapability.ArkUI.ArkUI.Full 2087 * @since 8 2088 */ 2089 /** 2090 * Transfer a PixelMap object to construct an ImageBitmap object. 2091 * 2092 * @param { PixelMap } data - PixelMap object 2093 * @syscap SystemCapability.ArkUI.ArkUI.Full 2094 * @crossplatform 2095 * @since 10 2096 */ 2097 /** 2098 * Transfer a PixelMap object to construct an ImageBitmap object. 2099 * 2100 * @param { PixelMap } data - PixelMap object 2101 * @syscap SystemCapability.ArkUI.ArkUI.Full 2102 * @crossplatform 2103 * @atomicservice 2104 * @since 11 2105 */ 2106 constructor(data: PixelMap); 2107 2108 /** 2109 * Transfer a PixelMap object to construct an ImageBitmap object. 2110 * 2111 * @param { PixelMap } data - PixelMap object 2112 * @param { LengthMetricsUnit } [unit] - the unit mode 2113 * @syscap SystemCapability.ArkUI.ArkUI.Full 2114 * @crossplatform 2115 * @atomicservice 2116 * @since 12 2117 */ 2118 constructor(data: PixelMap, unit: LengthMetricsUnit); 2119} 2120 2121/** 2122 * Image data object 2123 * 2124 * @syscap SystemCapability.ArkUI.ArkUI.Full 2125 * @since 8 2126 */ 2127/** 2128 * Image data object 2129 * 2130 * @syscap SystemCapability.ArkUI.ArkUI.Full 2131 * @form 2132 * @since 9 2133 */ 2134/** 2135 * Image data object 2136 * 2137 * @syscap SystemCapability.ArkUI.ArkUI.Full 2138 * @crossplatform 2139 * @form 2140 * @since 10 2141 */ 2142/** 2143 * Image data object 2144 * 2145 * @syscap SystemCapability.ArkUI.ArkUI.Full 2146 * @crossplatform 2147 * @form 2148 * @atomicservice 2149 * @since 11 2150 */ 2151declare class ImageData { 2152 /** 2153 * Array containing image pixel data 2154 * 2155 * @type { Uint8ClampedArray } 2156 * @readonly 2157 * @syscap SystemCapability.ArkUI.ArkUI.Full 2158 * @since 8 2159 */ 2160 /** 2161 * Array containing image pixel data 2162 * 2163 * @type { Uint8ClampedArray } 2164 * @readonly 2165 * @syscap SystemCapability.ArkUI.ArkUI.Full 2166 * @form 2167 * @since 9 2168 */ 2169 /** 2170 * Array containing image pixel data 2171 * 2172 * @type { Uint8ClampedArray } 2173 * @readonly 2174 * @syscap SystemCapability.ArkUI.ArkUI.Full 2175 * @crossplatform 2176 * @form 2177 * @since 10 2178 */ 2179 /** 2180 * Array containing image pixel data 2181 * 2182 * @type { Uint8ClampedArray } 2183 * @readonly 2184 * @syscap SystemCapability.ArkUI.ArkUI.Full 2185 * @crossplatform 2186 * @form 2187 * @atomicservice 2188 * @since 11 2189 */ 2190 readonly data: Uint8ClampedArray; 2191 2192 /** 2193 * Width of the image. 2194 * 2195 * @type { number } 2196 * @readonly 2197 * @syscap SystemCapability.ArkUI.ArkUI.Full 2198 * @since 8 2199 */ 2200 /** 2201 * Width of the image. 2202 * 2203 * @type { number } 2204 * @readonly 2205 * @syscap SystemCapability.ArkUI.ArkUI.Full 2206 * @form 2207 * @since 9 2208 */ 2209 /** 2210 * Width of the image. 2211 * 2212 * @type { number } 2213 * @readonly 2214 * @syscap SystemCapability.ArkUI.ArkUI.Full 2215 * @crossplatform 2216 * @form 2217 * @since 10 2218 */ 2219 /** 2220 * Width of the image. 2221 * 2222 * @type { number } 2223 * @readonly 2224 * @syscap SystemCapability.ArkUI.ArkUI.Full 2225 * @crossplatform 2226 * @form 2227 * @atomicservice 2228 * @since 11 2229 */ 2230 readonly height: number; 2231 2232 /** 2233 * Height of the image. 2234 * 2235 * @type { number } 2236 * @readonly 2237 * @syscap SystemCapability.ArkUI.ArkUI.Full 2238 * @since 8 2239 */ 2240 /** 2241 * Height of the image. 2242 * 2243 * @type { number } 2244 * @readonly 2245 * @syscap SystemCapability.ArkUI.ArkUI.Full 2246 * @form 2247 * @since 9 2248 */ 2249 /** 2250 * Height of the image. 2251 * 2252 * @type { number } 2253 * @readonly 2254 * @syscap SystemCapability.ArkUI.ArkUI.Full 2255 * @crossplatform 2256 * @form 2257 * @since 10 2258 */ 2259 /** 2260 * Height of the image. 2261 * 2262 * @type { number } 2263 * @readonly 2264 * @syscap SystemCapability.ArkUI.ArkUI.Full 2265 * @crossplatform 2266 * @form 2267 * @atomicservice 2268 * @since 11 2269 */ 2270 readonly width: number; 2271 2272 /** 2273 * Create an ImageData object based on the input parameters. 2274 * 2275 * @param { number } width - Width of the image. 2276 * @param { number } height - Height of the image. 2277 * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. 2278 * @syscap SystemCapability.ArkUI.ArkUI.Full 2279 * @since 8 2280 */ 2281 /** 2282 * Create an ImageData object based on the input parameters. 2283 * 2284 * @param { number } width - Width of the image. 2285 * @param { number } height - Height of the image. 2286 * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. 2287 * @syscap SystemCapability.ArkUI.ArkUI.Full 2288 * @form 2289 * @since 9 2290 */ 2291 /** 2292 * Create an ImageData object based on the input parameters. 2293 * 2294 * @param { number } width - Width of the image. 2295 * @param { number } height - Height of the image. 2296 * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. 2297 * @syscap SystemCapability.ArkUI.ArkUI.Full 2298 * @crossplatform 2299 * @form 2300 * @since 10 2301 */ 2302 /** 2303 * Create an ImageData object based on the input parameters. 2304 * 2305 * @param { number } width - Width of the image. 2306 * @param { number } height - Height of the image. 2307 * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. 2308 * @syscap SystemCapability.ArkUI.ArkUI.Full 2309 * @crossplatform 2310 * @form 2311 * @atomicservice 2312 * @since 11 2313 */ 2314 constructor(width: number, height: number, data?: Uint8ClampedArray); 2315 2316 /** 2317 * Create an ImageData object based on the input parameters. 2318 * 2319 * @param { number } width - Width of the image. 2320 * @param { number } height - Height of the image. 2321 * @param { Uint8ClampedArray } data - Data of the image. If this parameter is not specified, the default value is a black rectangular image. 2322 * @param { LengthMetricsUnit } [unit] - the unit mode 2323 * @syscap SystemCapability.ArkUI.ArkUI.Full 2324 * @crossplatform 2325 * @form 2326 * @atomicservice 2327 * @since 12 2328 */ 2329 constructor(width: number, height: number, data?: Uint8ClampedArray, unit?: LengthMetricsUnit); 2330} 2331 2332/** 2333 * This object allows you to set properties when creating a rendering context 2334 * 2335 * @syscap SystemCapability.ArkUI.ArkUI.Full 2336 * @since 8 2337 */ 2338/** 2339 * This object allows you to set properties when creating a rendering context 2340 * 2341 * @syscap SystemCapability.ArkUI.ArkUI.Full 2342 * @form 2343 * @since 9 2344 */ 2345/** 2346 * This object allows you to set properties when creating a rendering context 2347 * 2348 * @syscap SystemCapability.ArkUI.ArkUI.Full 2349 * @crossplatform 2350 * @form 2351 * @since 10 2352 */ 2353/** 2354 * This object allows you to set properties when creating a rendering context 2355 * 2356 * @syscap SystemCapability.ArkUI.ArkUI.Full 2357 * @crossplatform 2358 * @form 2359 * @atomicservice 2360 * @since 11 2361 */ 2362declare class RenderingContextSettings { 2363 /** 2364 * Indicates whether anti-aliasing is enabled for canvas. The default value is false. 2365 * 2366 * @type { ?boolean } 2367 * @syscap SystemCapability.ArkUI.ArkUI.Full 2368 * @since 8 2369 */ 2370 /** 2371 * Indicates whether anti-aliasing is enabled for canvas. The default value is false. 2372 * 2373 * @type { ?boolean } 2374 * @syscap SystemCapability.ArkUI.ArkUI.Full 2375 * @form 2376 * @since 9 2377 */ 2378 /** 2379 * Indicates whether anti-aliasing is enabled for canvas. The default value is false. 2380 * 2381 * @type { ?boolean } 2382 * @syscap SystemCapability.ArkUI.ArkUI.Full 2383 * @crossplatform 2384 * @form 2385 * @since 10 2386 */ 2387 /** 2388 * Indicates whether anti-aliasing is enabled for canvas. The default value is false. 2389 * 2390 * @type { ?boolean } 2391 * @syscap SystemCapability.ArkUI.ArkUI.Full 2392 * @crossplatform 2393 * @form 2394 * @atomicservice 2395 * @since 11 2396 */ 2397 antialias?: boolean; 2398 2399 /** 2400 * Create an RenderingContextSettings object based on the antialias and alpha. 2401 * 2402 * @param { boolean } antialias - Indicates whether anti-aliasing is enabled for canvas 2403 * @syscap SystemCapability.ArkUI.ArkUI.Full 2404 * @since 8 2405 */ 2406 /** 2407 * Create an RenderingContextSettings object based on the antialias and alpha. 2408 * 2409 * @param { boolean } antialias - Indicates whether anti-aliasing is enabled for canvas 2410 * @syscap SystemCapability.ArkUI.ArkUI.Full 2411 * @form 2412 * @since 9 2413 */ 2414 /** 2415 * Create an RenderingContextSettings object based on the antialias and alpha. 2416 * 2417 * @param { boolean } antialias - Indicates whether anti-aliasing is enabled for canvas 2418 * @syscap SystemCapability.ArkUI.ArkUI.Full 2419 * @crossplatform 2420 * @form 2421 * @since 10 2422 */ 2423 /** 2424 * Create an RenderingContextSettings object based on the antialias and alpha. 2425 * 2426 * @param { boolean } antialias - Indicates whether anti-aliasing is enabled for canvas 2427 * @syscap SystemCapability.ArkUI.ArkUI.Full 2428 * @crossplatform 2429 * @form 2430 * @atomicservice 2431 * @since 11 2432 */ 2433 constructor(antialias?: boolean); 2434} 2435 2436/** 2437 * Canvas renderer for drawing shapes, text, images and other objects 2438 * 2439 * @extends CanvasPath 2440 * @syscap SystemCapability.ArkUI.ArkUI.Full 2441 * @since 8 2442 */ 2443/** 2444 * Canvas renderer for drawing shapes, text, images and other objects 2445 * 2446 * @extends CanvasPath 2447 * @syscap SystemCapability.ArkUI.ArkUI.Full 2448 * @form 2449 * @since 9 2450 */ 2451/** 2452 * Canvas renderer for drawing shapes, text, images and other objects 2453 * 2454 * @extends CanvasPath 2455 * @syscap SystemCapability.ArkUI.ArkUI.Full 2456 * @crossplatform 2457 * @form 2458 * @since 10 2459 */ 2460/** 2461 * Canvas renderer for drawing shapes, text, images and other objects 2462 * 2463 * @extends CanvasPath 2464 * @syscap SystemCapability.ArkUI.ArkUI.Full 2465 * @crossplatform 2466 * @form 2467 * @atomicservice 2468 * @since 11 2469 */ 2470declare class CanvasRenderer extends CanvasPath { 2471 /** 2472 * Set spacing for letter. 2473 * 2474 * @type { LengthMetrics | string } 2475 * @default 0vp 2476 * @syscap SystemCapability.ArkUI.ArkUI.Full 2477 * @crossplatform 2478 * @atomicservice 2479 * @since 18 2480 */ 2481 letterSpacing: LengthMetrics | string; 2482 2483 /** 2484 * Transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). 2485 * If the value is out of range, the assignment is invalid. 2486 * 2487 * @type { number } 2488 * @default 1.0 2489 * @syscap SystemCapability.ArkUI.ArkUI.Full 2490 * @since 8 2491 */ 2492 /** 2493 * Transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). 2494 * If the value is out of range, the assignment is invalid. 2495 * 2496 * @type { number } 2497 * @default 1.0 2498 * @syscap SystemCapability.ArkUI.ArkUI.Full 2499 * @form 2500 * @since 9 2501 */ 2502 /** 2503 * Transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). 2504 * If the value is out of range, the assignment is invalid. 2505 * 2506 * @type { number } 2507 * @default 1.0 2508 * @syscap SystemCapability.ArkUI.ArkUI.Full 2509 * @crossplatform 2510 * @form 2511 * @since 10 2512 */ 2513 /** 2514 * Transparency. The value ranges from 0.0 (completely transparent) to 1.0 (completely opaque). 2515 * If the value is out of range, the assignment is invalid. 2516 * 2517 * @type { number } 2518 * @default 1.0 2519 * @syscap SystemCapability.ArkUI.ArkUI.Full 2520 * @crossplatform 2521 * @form 2522 * @atomicservice 2523 * @since 11 2524 */ 2525 globalAlpha: number; 2526 2527 /** 2528 * Type of composition operation applied when drawing a new shape. The following types are supported: 2529 * source-over: (Default) Draws a new drawing on top of an existing canvas context. 2530 * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. 2531 * Everything else is transparent. 2532 * source-out: Draws a new drawing where it does not overlap with the existing canvas content. 2533 * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. 2534 * destination-over: Draws a new graphic behind the existing canvas content. 2535 * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. 2536 * Everything else is transparent. 2537 * destination-out: Existing content remains where the new drawing does not overlap. 2538 * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, 2539 * which is drawn behind the canvas content. 2540 * lighter: The color of two overlapping shapes is determined by adding the color values. 2541 * copy: Only new graphics are displayed. 2542 * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. 2543 * 2544 * @type { string } 2545 * @default source-over 2546 * @syscap SystemCapability.ArkUI.ArkUI.Full 2547 * @since 8 2548 */ 2549 /** 2550 * Type of composition operation applied when drawing a new shape. The following types are supported: 2551 * source-over: (Default) Draws a new drawing on top of an existing canvas context. 2552 * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. 2553 * Everything else is transparent. 2554 * source-out: Draws a new drawing where it does not overlap with the existing canvas content. 2555 * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. 2556 * destination-over: Draws a new graphic behind the existing canvas content. 2557 * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. 2558 * Everything else is transparent. 2559 * destination-out: Existing content remains where the new drawing does not overlap. 2560 * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, 2561 * which is drawn behind the canvas content. 2562 * lighter: The color of two overlapping shapes is determined by adding the color values. 2563 * copy: Only new graphics are displayed. 2564 * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. 2565 * 2566 * @type { string } 2567 * @default source-over 2568 * @syscap SystemCapability.ArkUI.ArkUI.Full 2569 * @form 2570 * @since 9 2571 */ 2572 /** 2573 * Type of composition operation applied when drawing a new shape. The following types are supported: 2574 * source-over: (Default) Draws a new drawing on top of an existing canvas context. 2575 * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. 2576 * Everything else is transparent. 2577 * source-out: Draws a new drawing where it does not overlap with the existing canvas content. 2578 * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. 2579 * destination-over: Draws a new graphic behind the existing canvas content. 2580 * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. 2581 * Everything else is transparent. 2582 * destination-out: Existing content remains where the new drawing does not overlap. 2583 * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, 2584 * which is drawn behind the canvas content. 2585 * lighter: The color of two overlapping shapes is determined by adding the color values. 2586 * copy: Only new graphics are displayed. 2587 * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. 2588 * 2589 * @type { string } 2590 * @default source-over 2591 * @syscap SystemCapability.ArkUI.ArkUI.Full 2592 * @crossplatform 2593 * @form 2594 * @since 10 2595 */ 2596 /** 2597 * Type of composition operation applied when drawing a new shape. The following types are supported: 2598 * source-over: (Default) Draws a new drawing on top of an existing canvas context. 2599 * source-in: The new drawing is drawn only where the new drawing overlaps the target canvas. 2600 * Everything else is transparent. 2601 * source-out: Draws a new drawing where it does not overlap with the existing canvas content. 2602 * source-atop: The new drawing is drawn only where it overlaps the content of the existing canvas. 2603 * destination-over: Draws a new graphic behind the existing canvas content. 2604 * destination-in: Existing canvas content remains where the new drawing overlaps the existing canvas content. 2605 * Everything else is transparent. 2606 * destination-out: Existing content remains where the new drawing does not overlap. 2607 * destination-atop: The existing canvas retains only the part that overlaps with the new drawing, 2608 * which is drawn behind the canvas content. 2609 * lighter: The color of two overlapping shapes is determined by adding the color values. 2610 * copy: Only new graphics are displayed. 2611 * xor: In the image, those overlaps and other places outside of the normal drawing are transparent. 2612 * 2613 * @type { string } 2614 * @default source-over 2615 * @syscap SystemCapability.ArkUI.ArkUI.Full 2616 * @crossplatform 2617 * @form 2618 * @atomicservice 2619 * @since 11 2620 */ 2621 globalCompositeOperation: string; 2622 2623 /** 2624 * Draw an image on a canvas 2625 * 2626 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2627 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2628 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2629 * @syscap SystemCapability.ArkUI.ArkUI.Full 2630 * @since 8 2631 */ 2632 /** 2633 * Draw an image on a canvas 2634 * 2635 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2636 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2637 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2638 * @syscap SystemCapability.ArkUI.ArkUI.Full 2639 * @form 2640 * @since 9 2641 */ 2642 /** 2643 * Draw an image on a canvas 2644 * 2645 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2646 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2647 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2648 * @syscap SystemCapability.ArkUI.ArkUI.Full 2649 * @crossplatform 2650 * @form 2651 * @since 10 2652 */ 2653 /** 2654 * Draw an image on a canvas 2655 * 2656 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2657 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2658 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2659 * @syscap SystemCapability.ArkUI.ArkUI.Full 2660 * @crossplatform 2661 * @form 2662 * @atomicservice 2663 * @since 11 2664 */ 2665 drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number): void; 2666 2667 /** 2668 * Draw an image on a canvas 2669 * 2670 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2671 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2672 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2673 * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. 2674 * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. 2675 * @syscap SystemCapability.ArkUI.ArkUI.Full 2676 * @since 8 2677 */ 2678 /** 2679 * Draw an image on a canvas 2680 * 2681 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2682 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2683 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2684 * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. 2685 * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. 2686 * @syscap SystemCapability.ArkUI.ArkUI.Full 2687 * @form 2688 * @since 9 2689 */ 2690 /** 2691 * Draw an image on a canvas 2692 * 2693 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2694 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2695 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2696 * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. 2697 * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. 2698 * @syscap SystemCapability.ArkUI.ArkUI.Full 2699 * @crossplatform 2700 * @form 2701 * @since 10 2702 */ 2703 /** 2704 * Draw an image on a canvas 2705 * 2706 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2707 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2708 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2709 * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. 2710 * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. 2711 * @syscap SystemCapability.ArkUI.ArkUI.Full 2712 * @crossplatform 2713 * @form 2714 * @atomicservice 2715 * @since 11 2716 */ 2717 drawImage(image: ImageBitmap | PixelMap, dx: number, dy: number, dw: number, dh: number): void; 2718 2719 /** 2720 *Draw an image on a canvas 2721 * 2722 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2723 * @param { number } sx - x coordinate of the upper left corner of the rectangle (cropping) selection box of the image. 2724 * @param { number } sy - y coordinate of the upper left corner of the rectangle (cropping) selection box of the image. 2725 * @param { number } sw - Width of the rectangle (cropping) selection box of the image. 2726 * @param { number } sh - Height of the rectangle (cropping) selection box of the image. 2727 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2728 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2729 * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. 2730 * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. 2731 * @syscap SystemCapability.ArkUI.ArkUI.Full 2732 * @since 8 2733 */ 2734 /** 2735 *Draw an image on a canvas 2736 * 2737 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2738 * @param { number } sx - x coordinate of the upper left corner of the rectangle (cropping) selection box of the image. 2739 * @param { number } sy - y coordinate of the upper left corner of the rectangle (cropping) selection box of the image. 2740 * @param { number } sw - Width of the rectangle (cropping) selection box of the image. 2741 * @param { number } sh - Height of the rectangle (cropping) selection box of the image. 2742 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2743 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2744 * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. 2745 * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. 2746 * @syscap SystemCapability.ArkUI.ArkUI.Full 2747 * @form 2748 * @since 9 2749 */ 2750 /** 2751 *Draw an image on a canvas 2752 * 2753 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2754 * @param { number } sx - x coordinate of the upper left corner of the rectangle (cropping) selection box of the image. 2755 * @param { number } sy - y coordinate of the upper left corner of the rectangle (cropping) selection box of the image. 2756 * @param { number } sw - Width of the rectangle (cropping) selection box of the image. 2757 * @param { number } sh - Height of the rectangle (cropping) selection box of the image. 2758 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2759 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2760 * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. 2761 * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. 2762 * @syscap SystemCapability.ArkUI.ArkUI.Full 2763 * @crossplatform 2764 * @form 2765 * @since 10 2766 */ 2767 /** 2768 *Draw an image on a canvas 2769 * 2770 * @param { ImageBitmap | PixelMap } image - Picture objects drawn to the canvas. 2771 * @param { number } sx - x coordinate of the upper left corner of the rectangle (cropping) selection box of the image. 2772 * @param { number } sy - y coordinate of the upper left corner of the rectangle (cropping) selection box of the image. 2773 * @param { number } sw - Width of the rectangle (cropping) selection box of the image. 2774 * @param { number } sh - Height of the rectangle (cropping) selection box of the image. 2775 * @param { number } dx - x-axis coordinate of the upper left corner of the image on the target canvas. 2776 * @param { number } dy - y-axis coordinate of the upper left corner of the image on the target canvas. 2777 * @param { number } dw - Specifies the drawing width of the image on the target canvas. The width of the drawn image will be scaled. 2778 * @param { number } dh - Specifies the drawing height of the image on the target canvas. The height of the drawn image will be scaled. 2779 * @syscap SystemCapability.ArkUI.ArkUI.Full 2780 * @crossplatform 2781 * @form 2782 * @atomicservice 2783 * @since 11 2784 */ 2785 drawImage( 2786 image: ImageBitmap | PixelMap, 2787 sx: number, 2788 sy: number, 2789 sw: number, 2790 sh: number, 2791 dx: number, 2792 dy: number, 2793 dw: number, 2794 dh: number, 2795 ): void; 2796 2797 /** 2798 * Clear the sub-path list and start a new path. 2799 * 2800 * @syscap SystemCapability.ArkUI.ArkUI.Full 2801 * @since 8 2802 */ 2803 /** 2804 * Clear the sub-path list and start a new path. 2805 * 2806 * @syscap SystemCapability.ArkUI.ArkUI.Full 2807 * @form 2808 * @since 9 2809 */ 2810 /** 2811 * Clear the sub-path list and start a new path. 2812 * 2813 * @syscap SystemCapability.ArkUI.ArkUI.Full 2814 * @crossplatform 2815 * @form 2816 * @since 10 2817 */ 2818 /** 2819 * Clear the sub-path list and start a new path. 2820 * 2821 * @syscap SystemCapability.ArkUI.ArkUI.Full 2822 * @crossplatform 2823 * @form 2824 * @atomicservice 2825 * @since 11 2826 */ 2827 beginPath(): void; 2828 2829 /** 2830 * Sets the currently created path as the current clipping path 2831 * 2832 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2833 * @syscap SystemCapability.ArkUI.ArkUI.Full 2834 * @since 8 2835 */ 2836 /** 2837 * Sets the currently created path as the current clipping path 2838 * 2839 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2840 * @syscap SystemCapability.ArkUI.ArkUI.Full 2841 * @form 2842 * @since 9 2843 */ 2844 /** 2845 * Sets the currently created path as the current clipping path 2846 * 2847 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2848 * @syscap SystemCapability.ArkUI.ArkUI.Full 2849 * @crossplatform 2850 * @form 2851 * @since 10 2852 */ 2853 /** 2854 * Sets the currently created path as the current clipping path 2855 * 2856 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2857 * @syscap SystemCapability.ArkUI.ArkUI.Full 2858 * @crossplatform 2859 * @form 2860 * @atomicservice 2861 * @since 11 2862 */ 2863 clip(fillRule?: CanvasFillRule): void; 2864 2865 /** 2866 * Tailoring according to the specified path 2867 * 2868 * @param { Path2D } path - Path to be cut. 2869 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2870 * @syscap SystemCapability.ArkUI.ArkUI.Full 2871 * @since 8 2872 */ 2873 /** 2874 * Tailoring according to the specified path 2875 * 2876 * @param { Path2D } path - Path to be cut. 2877 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2878 * @syscap SystemCapability.ArkUI.ArkUI.Full 2879 * @form 2880 * @since 9 2881 */ 2882 /** 2883 * Tailoring according to the specified path 2884 * 2885 * @param { Path2D } path - Path to be cut. 2886 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2887 * @syscap SystemCapability.ArkUI.ArkUI.Full 2888 * @crossplatform 2889 * @form 2890 * @since 10 2891 */ 2892 /** 2893 * Tailoring according to the specified path 2894 * 2895 * @param { Path2D } path - Path to be cut. 2896 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2897 * @syscap SystemCapability.ArkUI.ArkUI.Full 2898 * @crossplatform 2899 * @form 2900 * @atomicservice 2901 * @since 11 2902 */ 2903 clip(path: Path2D, fillRule?: CanvasFillRule): void; 2904 2905 /** 2906 * Fills existing paths according to the current fill style. 2907 * 2908 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2909 * @syscap SystemCapability.ArkUI.ArkUI.Full 2910 * @since 8 2911 */ 2912 /** 2913 * Fills existing paths according to the current fill style. 2914 * 2915 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2916 * @syscap SystemCapability.ArkUI.ArkUI.Full 2917 * @form 2918 * @since 9 2919 */ 2920 /** 2921 * Fills existing paths according to the current fill style. 2922 * 2923 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2924 * @syscap SystemCapability.ArkUI.ArkUI.Full 2925 * @crossplatform 2926 * @form 2927 * @since 10 2928 */ 2929 /** 2930 * Fills existing paths according to the current fill style. 2931 * 2932 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2933 * @syscap SystemCapability.ArkUI.ArkUI.Full 2934 * @crossplatform 2935 * @form 2936 * @atomicservice 2937 * @since 11 2938 */ 2939 fill(fillRule?: CanvasFillRule): void; 2940 2941 /** 2942 * Fills the specified path according to the current fill style 2943 * 2944 * @param { Path2D } path - Path to be filled. 2945 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2946 * @syscap SystemCapability.ArkUI.ArkUI.Full 2947 * @since 8 2948 */ 2949 /** 2950 * Fills the specified path according to the current fill style 2951 * 2952 * @param { Path2D } path - Path to be filled. 2953 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2954 * @syscap SystemCapability.ArkUI.ArkUI.Full 2955 * @form 2956 * @since 9 2957 */ 2958 /** 2959 * Fills the specified path according to the current fill style 2960 * 2961 * @param { Path2D } path - Path to be filled. 2962 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2963 * @syscap SystemCapability.ArkUI.ArkUI.Full 2964 * @crossplatform 2965 * @form 2966 * @since 10 2967 */ 2968 /** 2969 * Fills the specified path according to the current fill style 2970 * 2971 * @param { Path2D } path - Path to be filled. 2972 * @param { CanvasFillRule } fillRule - Algorithm rule. For details, see {@link CanvasFillRule}. 2973 * @syscap SystemCapability.ArkUI.ArkUI.Full 2974 * @crossplatform 2975 * @form 2976 * @atomicservice 2977 * @since 11 2978 */ 2979 fill(path: Path2D, fillRule?: CanvasFillRule): void; 2980 2981 /** 2982 * Draws an existing path according to the current stroke style. 2983 * 2984 * @syscap SystemCapability.ArkUI.ArkUI.Full 2985 * @since 8 2986 */ 2987 /** 2988 * Draws an existing path according to the current stroke style. 2989 * 2990 * @syscap SystemCapability.ArkUI.ArkUI.Full 2991 * @form 2992 * @since 9 2993 */ 2994 /** 2995 * Draws an existing path according to the current stroke style. 2996 * 2997 * @syscap SystemCapability.ArkUI.ArkUI.Full 2998 * @crossplatform 2999 * @form 3000 * @since 10 3001 */ 3002 /** 3003 * Draws an existing path according to the current stroke style. 3004 * 3005 * @syscap SystemCapability.ArkUI.ArkUI.Full 3006 * @crossplatform 3007 * @form 3008 * @atomicservice 3009 * @since 11 3010 */ 3011 stroke(): void; 3012 3013 /** 3014 * Draws the specified path according to the current stroke style 3015 * 3016 * @param { Path2D } path - Specified stroke path object 3017 * @syscap SystemCapability.ArkUI.ArkUI.Full 3018 * @since 8 3019 */ 3020 /** 3021 * Draws the specified path according to the current stroke style 3022 * 3023 * @param { Path2D } path - Specified stroke path object 3024 * @syscap SystemCapability.ArkUI.ArkUI.Full 3025 * @form 3026 * @since 9 3027 */ 3028 /** 3029 * Draws the specified path according to the current stroke style 3030 * 3031 * @param { Path2D } path - Specified stroke path object 3032 * @syscap SystemCapability.ArkUI.ArkUI.Full 3033 * @crossplatform 3034 * @form 3035 * @since 10 3036 */ 3037 /** 3038 * Draws the specified path according to the current stroke style 3039 * 3040 * @param { Path2D } path - Specified stroke path object 3041 * @syscap SystemCapability.ArkUI.ArkUI.Full 3042 * @crossplatform 3043 * @form 3044 * @atomicservice 3045 * @since 11 3046 */ 3047 stroke(path: Path2D): void; 3048 3049 /** 3050 * Attributes that describe the fill color and style. The options are as follows: 3051 * color: Color String 3052 * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. 3053 * CanvasPattern: Template object. For details, see {@link CanvasPattern}. 3054 * 3055 * @type { string | CanvasGradient | CanvasPattern } 3056 * @default #000000 (black) 3057 * @syscap SystemCapability.ArkUI.ArkUI.Full 3058 * @since 8 3059 */ 3060 /** 3061 * Attributes that describe the fill color and style. The options are as follows: 3062 * color: Color String 3063 * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. 3064 * CanvasPattern: Template object. For details, see {@link CanvasPattern}. 3065 * 3066 * @type { string | CanvasGradient | CanvasPattern } 3067 * @default #000000 (black) 3068 * @syscap SystemCapability.ArkUI.ArkUI.Full 3069 * @form 3070 * @since 9 3071 */ 3072 /** 3073 * Attributes that describe the fill color and style. The options are as follows: 3074 * 3075 * @type { string | number | CanvasGradient | CanvasPattern } 3076 * string: Color String. 3077 * number: Indicates the color with number. 3078 * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. 3079 * CanvasPattern: Template object. For details, see {@link CanvasPattern}. 3080 * @default #000000 (black) 3081 * @syscap SystemCapability.ArkUI.ArkUI.Full 3082 * @crossplatform 3083 * @form 3084 * @since 10 3085 */ 3086 /** 3087 * Attributes that describe the fill color and style. The options are as follows: 3088 * 3089 * @type { string | number | CanvasGradient | CanvasPattern } 3090 * string: Color String. 3091 * number: Indicates the color with number. 3092 * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. 3093 * CanvasPattern: Template object. For details, see {@link CanvasPattern}. 3094 * @default #000000 (black) 3095 * @syscap SystemCapability.ArkUI.ArkUI.Full 3096 * @crossplatform 3097 * @form 3098 * @atomicservice 3099 * @since 11 3100 */ 3101 fillStyle: string | number | CanvasGradient | CanvasPattern; 3102 3103 /** 3104 * Attributes of the stroke color and style. The options are as follows: 3105 * color: Color String 3106 * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. 3107 * CanvasPattern: Template object. For details, see {@link CanvasPattern}. 3108 * 3109 * @type { string | CanvasGradient | CanvasPattern } 3110 * @default #000000 (black) 3111 * @syscap SystemCapability.ArkUI.ArkUI.Full 3112 * @since 8 3113 */ 3114 /** 3115 * Attributes of the stroke color and style. The options are as follows: 3116 * color: Color String 3117 * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. 3118 * CanvasPattern: Template object. For details, see {@link CanvasPattern}. 3119 * 3120 * @type { string | CanvasGradient | CanvasPattern } 3121 * @default #000000 (black) 3122 * @syscap SystemCapability.ArkUI.ArkUI.Full 3123 * @form 3124 * @since 9 3125 */ 3126 /** 3127 * Attributes of the stroke color and style. The options are as follows: 3128 * 3129 * @type { string | number | CanvasGradient | CanvasPattern } 3130 * string: Color String. 3131 * number: Indicates the color with number. 3132 * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. 3133 * CanvasPattern: Template object. For details, see {@link CanvasPattern}. 3134 * @default #000000 (black) 3135 * @syscap SystemCapability.ArkUI.ArkUI.Full 3136 * @crossplatform 3137 * @form 3138 * @since 10 3139 */ 3140 /** 3141 * Attributes of the stroke color and style. The options are as follows: 3142 * 3143 * @type { string | number | CanvasGradient | CanvasPattern } 3144 * string: Color String. 3145 * number: Indicates the color with number. 3146 * CanvasGradient: Color gradient object. For details, see {@link CanvasGradient}. 3147 * CanvasPattern: Template object. For details, see {@link CanvasPattern}. 3148 * @default #000000 (black) 3149 * @syscap SystemCapability.ArkUI.ArkUI.Full 3150 * @crossplatform 3151 * @form 3152 * @atomicservice 3153 * @since 11 3154 */ 3155 strokeStyle: string | number | CanvasGradient | CanvasPattern; 3156 3157 /** 3158 * Creates a linear gradient object that is specified along the parameter coordinates 3159 * 3160 * @param { number } x0 - The x-axis coordinate of the start point. 3161 * @param { number } y0 - The y-axis coordinate of the start point. 3162 * @param { number } x1 - x-axis coordinate of the end point. 3163 * @param { number } y1 - y-axis coordinate of the end point. 3164 * @returns { CanvasGradient } 3165 * @syscap SystemCapability.ArkUI.ArkUI.Full 3166 * @since 8 3167 */ 3168 /** 3169 * Creates a linear gradient object that is specified along the parameter coordinates 3170 * 3171 * @param { number } x0 - The x-axis coordinate of the start point. 3172 * @param { number } y0 - The y-axis coordinate of the start point. 3173 * @param { number } x1 - x-axis coordinate of the end point. 3174 * @param { number } y1 - y-axis coordinate of the end point. 3175 * @returns { CanvasGradient } 3176 * @syscap SystemCapability.ArkUI.ArkUI.Full 3177 * @form 3178 * @since 9 3179 */ 3180 /** 3181 * Creates a linear gradient object that is specified along the parameter coordinates 3182 * 3183 * @param { number } x0 - The x-axis coordinate of the start point. 3184 * @param { number } y0 - The y-axis coordinate of the start point. 3185 * @param { number } x1 - x-axis coordinate of the end point. 3186 * @param { number } y1 - y-axis coordinate of the end point. 3187 * @returns { CanvasGradient } 3188 * @syscap SystemCapability.ArkUI.ArkUI.Full 3189 * @crossplatform 3190 * @form 3191 * @since 10 3192 */ 3193 /** 3194 * Creates a linear gradient object that is specified along the parameter coordinates 3195 * 3196 * @param { number } x0 - The x-axis coordinate of the start point. 3197 * @param { number } y0 - The y-axis coordinate of the start point. 3198 * @param { number } x1 - x-axis coordinate of the end point. 3199 * @param { number } y1 - y-axis coordinate of the end point. 3200 * @returns { CanvasGradient } 3201 * @syscap SystemCapability.ArkUI.ArkUI.Full 3202 * @crossplatform 3203 * @form 3204 * @atomicservice 3205 * @since 11 3206 */ 3207 createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; 3208 3209 /** 3210 * Creates a template object using the specified image 3211 * 3212 * @param { ImageBitmap } image - Objects as duplicate image sources 3213 * @param { string | null } repetition - Specifies how to repeat images. The following four modes are supported: 3214 * "repeat": Repeated images in both X and Y directions 3215 * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction 3216 * "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction. 3217 * "no-repeat": Non-repeating images in both X and Y directions 3218 * @returns { CanvasPattern | null } 3219 * @syscap SystemCapability.ArkUI.ArkUI.Full 3220 * @since 8 3221 */ 3222 /** 3223 * Creates a template object using the specified image 3224 * 3225 * @param { ImageBitmap } image - Objects as duplicate image sources 3226 * @param { string | null } repetition - Specifies how to repeat images. The following four modes are supported: 3227 * "repeat": Repeated images in both X and Y directions 3228 * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction 3229 * "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction. 3230 * "no-repeat": Non-repeating images in both X and Y directions 3231 * @returns { CanvasPattern | null } 3232 * @syscap SystemCapability.ArkUI.ArkUI.Full 3233 * @form 3234 * @since 9 3235 */ 3236 /** 3237 * Creates a template object using the specified image 3238 * 3239 * @param { ImageBitmap } image - Objects as duplicate image sources 3240 * @param { string | null } repetition - Specifies how to repeat images. The following four modes are supported: 3241 * "repeat": Repeated images in both X and Y directions 3242 * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction 3243 * "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction. 3244 * "no-repeat": Non-repeating images in both X and Y directions 3245 * "clamp": Replicate the edge color if the shader draws outside of its original bounds. 3246 * "mirror": Repeat the shader's image horizontally and vertically, alternating mirror images so that adjacent images always seam. 3247 * @returns { CanvasPattern | null } 3248 * @syscap SystemCapability.ArkUI.ArkUI.Full 3249 * @crossplatform 3250 * @form 3251 * @since 10 3252 */ 3253 /** 3254 * Creates a template object using the specified image 3255 * 3256 * @param { ImageBitmap } image - Objects as duplicate image sources 3257 * @param { string | null } repetition - Specifies how to repeat images. The following four modes are supported: 3258 * "repeat": Repeated images in both X and Y directions 3259 * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction 3260 * "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction. 3261 * "no-repeat": Non-repeating images in both X and Y directions 3262 * "clamp": Replicate the edge color if the shader draws outside of its original bounds. 3263 * "mirror": Repeat the shader's image horizontally and vertically, alternating mirror images so that adjacent images always seam. 3264 * @returns { CanvasPattern | null } 3265 * @syscap SystemCapability.ArkUI.ArkUI.Full 3266 * @crossplatform 3267 * @form 3268 * @atomicservice 3269 * @since 11 3270 */ 3271 createPattern(image: ImageBitmap, repetition: string | null): CanvasPattern | null; 3272 3273 /** 3274 * Creates a radioactive gradient object based on parameters that determine the coordinates of two circles 3275 * 3276 * @param { number } x0 - The x-axis coordinate of the start circle. 3277 * @param { number } y0 - The y-axis coordinate of the start circle. 3278 * @param { number } r0 - Radius of the starting circle. 3279 * @param { number } x1 - The x-axis coordinate of the end circle. 3280 * @param { number } y1 - The y-axis coordinate of the end circle. 3281 * @param { number } r1 - Radius of the end circle. 3282 * @returns { CanvasGradient } 3283 * @syscap SystemCapability.ArkUI.ArkUI.Full 3284 * @since 8 3285 */ 3286 /** 3287 * Creates a radioactive gradient object based on parameters that determine the coordinates of two circles 3288 * 3289 * @param { number } x0 - The x-axis coordinate of the start circle. 3290 * @param { number } y0 - The y-axis coordinate of the start circle. 3291 * @param { number } r0 - Radius of the starting circle. 3292 * @param { number } x1 - The x-axis coordinate of the end circle. 3293 * @param { number } y1 - The y-axis coordinate of the end circle. 3294 * @param { number } r1 - Radius of the end circle. 3295 * @returns { CanvasGradient } 3296 * @syscap SystemCapability.ArkUI.ArkUI.Full 3297 * @form 3298 * @since 9 3299 */ 3300 /** 3301 * Creates a radioactive gradient object based on parameters that determine the coordinates of two circles 3302 * 3303 * @param { number } x0 - The x-axis coordinate of the start circle. 3304 * @param { number } y0 - The y-axis coordinate of the start circle. 3305 * @param { number } r0 - Radius of the starting circle. 3306 * @param { number } x1 - The x-axis coordinate of the end circle. 3307 * @param { number } y1 - The y-axis coordinate of the end circle. 3308 * @param { number } r1 - Radius of the end circle. 3309 * @returns { CanvasGradient } 3310 * @syscap SystemCapability.ArkUI.ArkUI.Full 3311 * @crossplatform 3312 * @form 3313 * @since 10 3314 */ 3315 /** 3316 * Creates a radioactive gradient object based on parameters that determine the coordinates of two circles 3317 * 3318 * @param { number } x0 - The x-axis coordinate of the start circle. 3319 * @param { number } y0 - The y-axis coordinate of the start circle. 3320 * @param { number } r0 - Radius of the starting circle. 3321 * @param { number } x1 - The x-axis coordinate of the end circle. 3322 * @param { number } y1 - The y-axis coordinate of the end circle. 3323 * @param { number } r1 - Radius of the end circle. 3324 * @returns { CanvasGradient } 3325 * @syscap SystemCapability.ArkUI.ArkUI.Full 3326 * @crossplatform 3327 * @form 3328 * @atomicservice 3329 * @since 11 3330 */ 3331 createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; 3332 3333 /** 3334 * Creates a gradient around a point with given coordinates. 3335 * 3336 * @param { number } startAngle - The angle at which to begin the gradient, in radians. 3337 * Angle measurements start horizontally the right of the center and move around clockwise. 3338 * @param { number } x - The x-axis coordinate of the center of the gradient. 3339 * @param { number } y - The y-axis coordinate of the center of the gradient. 3340 * @returns { CanvasGradient } A CanvasGradient object that draws a conic gradient around the given coordinates. 3341 * @syscap SystemCapability.ArkUI.ArkUI.Full 3342 * @crossplatform 3343 * @since 10 3344 */ 3345 /** 3346 * Creates a gradient around a point with given coordinates. 3347 * 3348 * @param { number } startAngle - The angle at which to begin the gradient, in radians. 3349 * Angle measurements start horizontally the right of the center and move around clockwise. 3350 * @param { number } x - The x-axis coordinate of the center of the gradient. 3351 * @param { number } y - The y-axis coordinate of the center of the gradient. 3352 * @returns { CanvasGradient } A CanvasGradient object that draws a conic gradient around the given coordinates. 3353 * @syscap SystemCapability.ArkUI.ArkUI.Full 3354 * @crossplatform 3355 * @atomicservice 3356 * @since 11 3357 */ 3358 createConicGradient( 3359 startAngle: number, 3360 x: number, 3361 y: number 3362 ): CanvasGradient; 3363 3364 /** 3365 * Provides filter effects such as blur and grayscale. You can set the following filter effects: 3366 * blur(<length>): Adds a Gaussian blur effect to the drawing 3367 * brightness(<percentage>): Provides a linear multiplication for the drawing and adjusts the brightness level. 3368 * contrast(<percentage>): Adjusts the contrast of the image. When the value is 0%, the image is completely black. 3369 * When the value is 100%, there is no change in the image. 3370 * grayscale(<percentage>): Converts the image to a gray image. When the value is 100%, the image is completely gray. 3371 * When the value is 0%, there is no change in the image. 3372 * hue-rotate(<degree>): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. 3373 * invert(<percentage>): Inverted image (representing the effect of a photographic negative). When the value is 100%, 3374 * the image is completely inverted. When the value is 0%, there is no change in the image. 3375 * opacity(<percentage>): Transparency of the image. At 0%, the image is completely transparent. 3376 * When the value is 100%, there is no change in the image. 3377 * saturate(<percentage>): Perform saturation processing on the image. At 0%, the image is completely un-saturated. 3378 * When the value is 100%, there is no change in the image. 3379 * sepia(<percentage>): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. 3380 * When the value is 0%, there is no change in the image. 3381 * none: Turn off filter effects 3382 * 3383 * @type { string } 3384 * @default none 3385 * @syscap SystemCapability.ArkUI.ArkUI.Full 3386 * @since 8 3387 */ 3388 /** 3389 * Provides filter effects such as blur and grayscale. You can set the following filter effects: 3390 * blur(<length>): Adds a Gaussian blur effect to the drawing 3391 * brightness(<percentage>): Provides a linear multiplication for the drawing and adjusts the brightness level. 3392 * contrast(<percentage>): Adjusts the contrast of the image. When the value is 0%, the image is completely black. 3393 * When the value is 100%, there is no change in the image. 3394 * grayscale(<percentage>): Converts the image to a gray image. When the value is 100%, the image is completely gray. 3395 * When the value is 0%, there is no change in the image. 3396 * hue-rotate(<degree>): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. 3397 * invert(<percentage>): Inverted image (representing the effect of a photographic negative). When the value is 100%, 3398 * the image is completely inverted. When the value is 0%, there is no change in the image. 3399 * opacity(<percentage>): Transparency of the image. At 0%, the image is completely transparent. 3400 * When the value is 100%, there is no change in the image. 3401 * saturate(<percentage>): Perform saturation processing on the image. At 0%, the image is completely un-saturated. 3402 * When the value is 100%, there is no change in the image. 3403 * sepia(<percentage>): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. 3404 * When the value is 0%, there is no change in the image. 3405 * none: Turn off filter effects 3406 * 3407 * @type { string } 3408 * @default none 3409 * @syscap SystemCapability.ArkUI.ArkUI.Full 3410 * @form 3411 * @since 9 3412 */ 3413 /** 3414 * Provides filter effects such as blur and grayscale. You can set the following filter effects: 3415 * blur(<length>): Adds a Gaussian blur effect to the drawing 3416 * brightness(<percentage>): Provides a linear multiplication for the drawing and adjusts the brightness level. 3417 * contrast(<percentage>): Adjusts the contrast of the image. When the value is 0%, the image is completely black. 3418 * When the value is 100%, there is no change in the image. 3419 * grayscale(<percentage>): Converts the image to a gray image. When the value is 100%, the image is completely gray. 3420 * When the value is 0%, there is no change in the image. 3421 * hue-rotate(<degree>): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. 3422 * invert(<percentage>): Inverted image (representing the effect of a photographic negative). When the value is 100%, 3423 * the image is completely inverted. When the value is 0%, there is no change in the image. 3424 * opacity(<percentage>): Transparency of the image. At 0%, the image is completely transparent. 3425 * When the value is 100%, there is no change in the image. 3426 * saturate(<percentage>): Perform saturation processing on the image. At 0%, the image is completely un-saturated. 3427 * When the value is 100%, there is no change in the image. 3428 * sepia(<percentage>): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. 3429 * When the value is 0%, there is no change in the image. 3430 * none: Turn off filter effects 3431 * 3432 * @type { string } 3433 * @default none 3434 * @syscap SystemCapability.ArkUI.ArkUI.Full 3435 * @crossplatform 3436 * @form 3437 * @since 10 3438 */ 3439 /** 3440 * Provides filter effects such as blur and grayscale. You can set the following filter effects: 3441 * blur(<length>): Adds a Gaussian blur effect to the drawing 3442 * brightness(<percentage>): Provides a linear multiplication for the drawing and adjusts the brightness level. 3443 * contrast(<percentage>): Adjusts the contrast of the image. When the value is 0%, the image is completely black. 3444 * When the value is 100%, there is no change in the image. 3445 * grayscale(<percentage>): Converts the image to a gray image. When the value is 100%, the image is completely gray. 3446 * When the value is 0%, there is no change in the image. 3447 * hue-rotate(<degree>): Perform color rotation on an image. When the value is 0 degrees, there is no change in the image. 3448 * invert(<percentage>): Inverted image (representing the effect of a photographic negative). When the value is 100%, 3449 * the image is completely inverted. When the value is 0%, there is no change in the image. 3450 * opacity(<percentage>): Transparency of the image. At 0%, the image is completely transparent. 3451 * When the value is 100%, there is no change in the image. 3452 * saturate(<percentage>): Perform saturation processing on the image. At 0%, the image is completely un-saturated. 3453 * When the value is 100%, there is no change in the image. 3454 * sepia(<percentage>): The image is sepia (nostalgic style). At 100%, the image turns completely sepia. 3455 * When the value is 0%, there is no change in the image. 3456 * none: Turn off filter effects 3457 * 3458 * @type { string } 3459 * @default none 3460 * @syscap SystemCapability.ArkUI.ArkUI.Full 3461 * @crossplatform 3462 * @form 3463 * @atomicservice 3464 * @since 11 3465 */ 3466 filter: string; 3467 3468 /** 3469 * Creates a new, empty ImageData object of the specified size 3470 * 3471 * @param { number } sw - Width of the ImageData object. 3472 * @param { number } sh - Height of the ImageData object. 3473 * @returns { ImageData } 3474 * @syscap SystemCapability.ArkUI.ArkUI.Full 3475 * @since 8 3476 */ 3477 /** 3478 * Creates a new, empty ImageData object of the specified size 3479 * 3480 * @param { number } sw - Width of the ImageData object. 3481 * @param { number } sh - Height of the ImageData object. 3482 * @returns { ImageData } 3483 * @syscap SystemCapability.ArkUI.ArkUI.Full 3484 * @form 3485 * @since 9 3486 */ 3487 /** 3488 * Creates a new, empty ImageData object of the specified size 3489 * 3490 * @param { number } sw - Width of the ImageData object. 3491 * @param { number } sh - Height of the ImageData object. 3492 * @returns { ImageData } 3493 * @syscap SystemCapability.ArkUI.ArkUI.Full 3494 * @crossplatform 3495 * @form 3496 * @since 10 3497 */ 3498 /** 3499 * Creates a new, empty ImageData object of the specified size 3500 * 3501 * @param { number } sw - Width of the ImageData object. 3502 * @param { number } sh - Height of the ImageData object. 3503 * @returns { ImageData } 3504 * @syscap SystemCapability.ArkUI.ArkUI.Full 3505 * @crossplatform 3506 * @form 3507 * @atomicservice 3508 * @since 11 3509 */ 3510 createImageData(sw: number, sh: number): ImageData; 3511 3512 /** 3513 * From an existing ImageData object, copy an object with the same width and height as the image. 3514 * The image content is not copied. 3515 * 3516 * @param { ImageData } imagedata - ImageData object to be copied. 3517 * @returns { ImageData } 3518 * @syscap SystemCapability.ArkUI.ArkUI.Full 3519 * @since 8 3520 */ 3521 /** 3522 * From an existing ImageData object, copy an object with the same width and height as the image. 3523 * The image content is not copied. 3524 * 3525 * @param { ImageData } imagedata - ImageData object to be copied. 3526 * @returns { ImageData } 3527 * @syscap SystemCapability.ArkUI.ArkUI.Full 3528 * @form 3529 * @since 9 3530 */ 3531 /** 3532 * From an existing ImageData object, copy an object with the same width and height as the image. 3533 * The image content is not copied. 3534 * 3535 * @param { ImageData } imagedata - ImageData object to be copied. 3536 * @returns { ImageData } 3537 * @syscap SystemCapability.ArkUI.ArkUI.Full 3538 * @crossplatform 3539 * @form 3540 * @since 10 3541 */ 3542 /** 3543 * From an existing ImageData object, copy an object with the same width and height as the image. 3544 * The image content is not copied. 3545 * 3546 * @param { ImageData } imagedata - ImageData object to be copied. 3547 * @returns { ImageData } 3548 * @syscap SystemCapability.ArkUI.ArkUI.Full 3549 * @crossplatform 3550 * @form 3551 * @atomicservice 3552 * @since 11 3553 */ 3554 createImageData(imagedata: ImageData): ImageData; 3555 3556 /** 3557 * Obtains the pixel data of a specified area on the current canvas. 3558 * 3559 * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the image data to be extracted. 3560 * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the image data to be extracted. 3561 * @param { number } sw - The width of the rectangular area of the image data to be extracted. 3562 * @param { number } sh - The height of the rectangular area of the image data to be extracted. 3563 * @returns { ImageData } 3564 * @syscap SystemCapability.ArkUI.ArkUI.Full 3565 * @since 8 3566 */ 3567 /** 3568 * Obtains the pixel data of a specified area on the current canvas. 3569 * 3570 * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the image data to be extracted. 3571 * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the image data to be extracted. 3572 * @param { number } sw - The width of the rectangular area of the image data to be extracted. 3573 * @param { number } sh - The height of the rectangular area of the image data to be extracted. 3574 * @returns { ImageData } 3575 * @syscap SystemCapability.ArkUI.ArkUI.Full 3576 * @form 3577 * @since 9 3578 */ 3579 /** 3580 * Obtains the pixel data of a specified area on the current canvas. 3581 * 3582 * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the image data to be extracted. 3583 * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the image data to be extracted. 3584 * @param { number } sw - The width of the rectangular area of the image data to be extracted. 3585 * @param { number } sh - The height of the rectangular area of the image data to be extracted. 3586 * @returns { ImageData } 3587 * @syscap SystemCapability.ArkUI.ArkUI.Full 3588 * @crossplatform 3589 * @form 3590 * @since 10 3591 */ 3592 /** 3593 * Obtains the pixel data of a specified area on the current canvas. 3594 * 3595 * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the image data to be extracted. 3596 * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the image data to be extracted. 3597 * @param { number } sw - The width of the rectangular area of the image data to be extracted. 3598 * @param { number } sh - The height of the rectangular area of the image data to be extracted. 3599 * @returns { ImageData } 3600 * @syscap SystemCapability.ArkUI.ArkUI.Full 3601 * @crossplatform 3602 * @form 3603 * @atomicservice 3604 * @since 11 3605 */ 3606 getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; 3607 3608 /** 3609 * Obtains the PixelMap of a specified area on the current canvas. 3610 * 3611 * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. 3612 * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. 3613 * @param { number } sw - The width of the rectangular area of the PixelMap to be extracted. 3614 * @param { number } sh - The height of the rectangular area of the PixelMap to be extracted. 3615 * @returns { PixelMap } 3616 * @syscap SystemCapability.ArkUI.ArkUI.Full 3617 * @since 8 3618 */ 3619 /** 3620 * Obtains the PixelMap of a specified area on the current canvas. 3621 * 3622 * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. 3623 * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. 3624 * @param { number } sw - The width of the rectangular area of the PixelMap to be extracted. 3625 * @param { number } sh - The height of the rectangular area of the PixelMap to be extracted. 3626 * @returns { PixelMap } 3627 * @syscap SystemCapability.ArkUI.ArkUI.Full 3628 * @crossplatform 3629 * @since 10 3630 */ 3631 /** 3632 * Obtains the PixelMap of a specified area on the current canvas. 3633 * 3634 * @param { number } sx - x coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. 3635 * @param { number } sy - y coordinate of the upper left corner of the rectangular area of the PixelMap to be extracted. 3636 * @param { number } sw - The width of the rectangular area of the PixelMap to be extracted. 3637 * @param { number } sh - The height of the rectangular area of the PixelMap to be extracted. 3638 * @returns { PixelMap } 3639 * @syscap SystemCapability.ArkUI.ArkUI.Full 3640 * @crossplatform 3641 * @atomicservice 3642 * @since 11 3643 */ 3644 getPixelMap(sx: number, sy: number, sw: number, sh: number): PixelMap; 3645 3646 /** 3647 * Draws the specified ImageData object onto the canvas 3648 * 3649 * @param { ImageData } imagedata - ImageData object to be drawn. 3650 * @param { number } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). 3651 * @param { number } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). 3652 * @syscap SystemCapability.ArkUI.ArkUI.Full 3653 * @since 8 3654 */ 3655 /** 3656 * Draws the specified ImageData object onto the canvas 3657 * 3658 * @param { ImageData } imagedata - ImageData object to be drawn. 3659 * @param { number } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). 3660 * @param { number } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). 3661 * @syscap SystemCapability.ArkUI.ArkUI.Full 3662 * @form 3663 * @since 9 3664 */ 3665 /** 3666 * Draws the specified ImageData object onto the canvas 3667 * 3668 * @param { ImageData } imagedata - ImageData object to be drawn. 3669 * @param { number | string } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). 3670 * @param { number | string } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). 3671 * @syscap SystemCapability.ArkUI.ArkUI.Full 3672 * @crossplatform 3673 * @form 3674 * @since 10 3675 */ 3676 /** 3677 * Draws the specified ImageData object onto the canvas 3678 * 3679 * @param { ImageData } imagedata - ImageData object to be drawn. 3680 * @param { number | string } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). 3681 * @param { number | string } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). 3682 * @syscap SystemCapability.ArkUI.ArkUI.Full 3683 * @crossplatform 3684 * @form 3685 * @atomicservice 3686 * @since 11 3687 */ 3688 putImageData(imagedata: ImageData, dx: number | string, dy: number | string): void; 3689 3690 /** 3691 * Draws the specified ImageData object onto the canvas 3692 * 3693 * @param { ImageData } imagedata - ImageData object to be drawn. 3694 * @param { number } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). 3695 * @param { number } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). 3696 * @param { number } dirtyX - Position of the upper left corner of the rectangular area in the source image data. 3697 * The default is the upper left corner (x coordinate) of the entire image data. 3698 * @param { number } dirtyY - Position of the upper left corner of the rectangular area in the source image data. 3699 * The default is the upper left corner (y coordinate) of the entire image data. 3700 * @param { number } dirtyWidth - Width of the rectangular area in the source image data. 3701 * The default is the width of the image data. 3702 * @param { number } dirtyHeight - Height of the rectangular area in the source image data. 3703 * The default is the height of the image data. 3704 * @syscap SystemCapability.ArkUI.ArkUI.Full 3705 * @since 8 3706 */ 3707 /** 3708 * Draws the specified ImageData object onto the canvas 3709 * 3710 * @param { ImageData } imagedata - ImageData object to be drawn. 3711 * @param { number } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). 3712 * @param { number } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). 3713 * @param { number } dirtyX - Position of the upper left corner of the rectangular area in the source image data. 3714 * The default is the upper left corner (x coordinate) of the entire image data. 3715 * @param { number } dirtyY - Position of the upper left corner of the rectangular area in the source image data. 3716 * The default is the upper left corner (y coordinate) of the entire image data. 3717 * @param { number } dirtyWidth - Width of the rectangular area in the source image data. 3718 * The default is the width of the image data. 3719 * @param { number } dirtyHeight - Height of the rectangular area in the source image data. 3720 * The default is the height of the image data. 3721 * @syscap SystemCapability.ArkUI.ArkUI.Full 3722 * @form 3723 * @since 9 3724 */ 3725 /** 3726 * Draws the specified ImageData object onto the canvas 3727 * 3728 * @param { ImageData } imagedata - ImageData object to be drawn. 3729 * @param { number | string } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). 3730 * @param { number | string } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). 3731 * @param { number | string } dirtyX - Position of the upper left corner of the rectangular area in the source image data. 3732 * The default is the upper left corner (x coordinate) of the entire image data. 3733 * @param { number | string } dirtyY - Position of the upper left corner of the rectangular area in the source image data. 3734 * The default is the upper left corner (y coordinate) of the entire image data. 3735 * @param { number | string } dirtyWidth - Width of the rectangular area in the source image data. 3736 * The default is the width of the image data. 3737 * @param { number | string } dirtyHeight - Height of the rectangular area in the source image data. 3738 * The default is the height of the image data. 3739 * @syscap SystemCapability.ArkUI.ArkUI.Full 3740 * @crossplatform 3741 * @form 3742 * @since 10 3743 */ 3744 /** 3745 * Draws the specified ImageData object onto the canvas 3746 * 3747 * @param { ImageData } imagedata - ImageData object to be drawn. 3748 * @param { number | string } dx - Position offset of the source image data in the target canvas (the offset in the x-axis direction). 3749 * @param { number | string } dy - Position offset of the source image data in the target canvas (the offset in the y-axis direction). 3750 * @param { number | string } dirtyX - Position of the upper left corner of the rectangular area in the source image data. 3751 * The default is the upper left corner (x coordinate) of the entire image data. 3752 * @param { number | string } dirtyY - Position of the upper left corner of the rectangular area in the source image data. 3753 * The default is the upper left corner (y coordinate) of the entire image data. 3754 * @param { number | string } dirtyWidth - Width of the rectangular area in the source image data. 3755 * The default is the width of the image data. 3756 * @param { number | string } dirtyHeight - Height of the rectangular area in the source image data. 3757 * The default is the height of the image data. 3758 * @syscap SystemCapability.ArkUI.ArkUI.Full 3759 * @crossplatform 3760 * @form 3761 * @atomicservice 3762 * @since 11 3763 */ 3764 putImageData( 3765 imagedata: ImageData, 3766 dx: number | string, 3767 dy: number | string, 3768 dirtyX: number | string, 3769 dirtyY: number | string, 3770 dirtyWidth: number | string, 3771 dirtyHeight: number | string 3772 ): void; 3773 3774 /** 3775 * Specifies whether to smooth the image. The value true indicates that the image is smooth. 3776 * The value false indicates that the image is not smooth. 3777 * 3778 * @type { boolean } 3779 * @default true 3780 * @syscap SystemCapability.ArkUI.ArkUI.Full 3781 * @since 8 3782 */ 3783 /** 3784 * Specifies whether to smooth the image. The value true indicates that the image is smooth. 3785 * The value false indicates that the image is not smooth. 3786 * 3787 * @type { boolean } 3788 * @default true 3789 * @syscap SystemCapability.ArkUI.ArkUI.Full 3790 * @form 3791 * @since 9 3792 */ 3793 /** 3794 * Specifies whether to smooth the image. The value true indicates that the image is smooth. 3795 * The value false indicates that the image is not smooth. 3796 * 3797 * @type { boolean } 3798 * @default true 3799 * @syscap SystemCapability.ArkUI.ArkUI.Full 3800 * @crossplatform 3801 * @form 3802 * @since 10 3803 */ 3804 /** 3805 * Specifies whether to smooth the image. The value true indicates that the image is smooth. 3806 * The value false indicates that the image is not smooth. 3807 * 3808 * @type { boolean } 3809 * @default true 3810 * @syscap SystemCapability.ArkUI.ArkUI.Full 3811 * @crossplatform 3812 * @form 3813 * @atomicservice 3814 * @since 11 3815 */ 3816 imageSmoothingEnabled: boolean; 3817 3818 /** 3819 * Smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. 3820 * 3821 * @type { ImageSmoothingQuality } 3822 * @default low 3823 * @syscap SystemCapability.ArkUI.ArkUI.Full 3824 * @since 8 3825 */ 3826 /** 3827 * Smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. 3828 * 3829 * @type { ImageSmoothingQuality } 3830 * @default low 3831 * @syscap SystemCapability.ArkUI.ArkUI.Full 3832 * @form 3833 * @since 9 3834 */ 3835 /** 3836 * Smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. 3837 * 3838 * @type { ImageSmoothingQuality } 3839 * @default low 3840 * @syscap SystemCapability.ArkUI.ArkUI.Full 3841 * @crossplatform 3842 * @form 3843 * @since 10 3844 */ 3845 /** 3846 * Smoothness level of the current image. For details, see {@link ImageSmoothingQuality}. 3847 * 3848 * @type { ImageSmoothingQuality } 3849 * @default low 3850 * @syscap SystemCapability.ArkUI.ArkUI.Full 3851 * @crossplatform 3852 * @form 3853 * @atomicservice 3854 * @since 11 3855 */ 3856 imageSmoothingQuality: ImageSmoothingQuality; 3857 3858 /** 3859 * Line segment endpoint attribute. For details, see {@link CanvasLineCap}. 3860 * 3861 * @type { CanvasLineCap } 3862 * @default butt 3863 * @syscap SystemCapability.ArkUI.ArkUI.Full 3864 * @since 8 3865 */ 3866 /** 3867 * Line segment endpoint attribute. For details, see {@link CanvasLineCap}. 3868 * 3869 * @type { CanvasLineCap } 3870 * @default butt 3871 * @syscap SystemCapability.ArkUI.ArkUI.Full 3872 * @form 3873 * @since 9 3874 */ 3875 /** 3876 * Line segment endpoint attribute. For details, see {@link CanvasLineCap}. 3877 * 3878 * @type { CanvasLineCap } 3879 * @default butt 3880 * @syscap SystemCapability.ArkUI.ArkUI.Full 3881 * @crossplatform 3882 * @form 3883 * @since 10 3884 */ 3885 /** 3886 * Line segment endpoint attribute. For details, see {@link CanvasLineCap}. 3887 * 3888 * @type { CanvasLineCap } 3889 * @default butt 3890 * @syscap SystemCapability.ArkUI.ArkUI.Full 3891 * @crossplatform 3892 * @form 3893 * @atomicservice 3894 * @since 11 3895 */ 3896 lineCap: CanvasLineCap; 3897 3898 /** 3899 * Dotted line offset attribute. 3900 * 3901 * @type { number } 3902 * @default 0.0 3903 * @syscap SystemCapability.ArkUI.ArkUI.Full 3904 * @since 8 3905 */ 3906 /** 3907 * Dotted line offset attribute. 3908 * 3909 * @type { number } 3910 * @default 0.0 3911 * @syscap SystemCapability.ArkUI.ArkUI.Full 3912 * @form 3913 * @since 9 3914 */ 3915 /** 3916 * Dotted line offset attribute. 3917 * 3918 * @type { number } 3919 * @default 0.0 3920 * @syscap SystemCapability.ArkUI.ArkUI.Full 3921 * @crossplatform 3922 * @form 3923 * @since 10 3924 */ 3925 /** 3926 * Dotted line offset attribute. 3927 * 3928 * @type { number } 3929 * @default 0.0 3930 * @syscap SystemCapability.ArkUI.ArkUI.Full 3931 * @crossplatform 3932 * @form 3933 * @atomicservice 3934 * @since 11 3935 */ 3936 lineDashOffset: number; 3937 3938 /** 3939 * Line segment connection point attribute. For details, see {@link CanvasLineJoin}. 3940 * 3941 * @type { CanvasLineJoin } 3942 * @default miter 3943 * @syscap SystemCapability.ArkUI.ArkUI.Full 3944 * @since 8 3945 */ 3946 /** 3947 * Line segment connection point attribute. For details, see {@link CanvasLineJoin}. 3948 * 3949 * @type { CanvasLineJoin } 3950 * @default miter 3951 * @syscap SystemCapability.ArkUI.ArkUI.Full 3952 * @form 3953 * @since 9 3954 */ 3955 /** 3956 * Line segment connection point attribute. For details, see {@link CanvasLineJoin}. 3957 * 3958 * @type { CanvasLineJoin } 3959 * @default miter 3960 * @syscap SystemCapability.ArkUI.ArkUI.Full 3961 * @crossplatform 3962 * @form 3963 * @since 10 3964 */ 3965 /** 3966 * Line segment connection point attribute. For details, see {@link CanvasLineJoin}. 3967 * 3968 * @type { CanvasLineJoin } 3969 * @default miter 3970 * @syscap SystemCapability.ArkUI.ArkUI.Full 3971 * @crossplatform 3972 * @form 3973 * @atomicservice 3974 * @since 11 3975 */ 3976 lineJoin: CanvasLineJoin; 3977 3978 /** 3979 * Line thickness attribute. The value cannot be 0 or a negative number. 3980 * 3981 * @type { number } 3982 * @default 1(px) 3983 * @syscap SystemCapability.ArkUI.ArkUI.Full 3984 * @since 8 3985 */ 3986 /** 3987 * Line thickness attribute. The value cannot be 0 or a negative number. 3988 * 3989 * @type { number } 3990 * @default 1(px) 3991 * @syscap SystemCapability.ArkUI.ArkUI.Full 3992 * @form 3993 * @since 9 3994 */ 3995 /** 3996 * Line thickness attribute. The value cannot be 0 or a negative number. 3997 * 3998 * @type { number } 3999 * @default 1(px) 4000 * @syscap SystemCapability.ArkUI.ArkUI.Full 4001 * @crossplatform 4002 * @form 4003 * @since 10 4004 */ 4005 /** 4006 * Line thickness attribute. The value cannot be 0 or a negative number. 4007 * 4008 * @type { number } 4009 * @default 1(px) 4010 * @syscap SystemCapability.ArkUI.ArkUI.Full 4011 * @crossplatform 4012 * @form 4013 * @atomicservice 4014 * @since 11 4015 */ 4016 lineWidth: number; 4017 4018 /** 4019 * The value of this parameter cannot be 0 or a negative number. 4020 * 4021 * @type { number } 4022 * @default 10(px) 4023 * @syscap SystemCapability.ArkUI.ArkUI.Full 4024 * @since 8 4025 */ 4026 /** 4027 * The value of this parameter cannot be 0 or a negative number. 4028 * 4029 * @type { number } 4030 * @default 10(px) 4031 * @syscap SystemCapability.ArkUI.ArkUI.Full 4032 * @form 4033 * @since 9 4034 */ 4035 /** 4036 * The value of this parameter cannot be 0 or a negative number. 4037 * 4038 * @type { number } 4039 * @default 10(px) 4040 * @syscap SystemCapability.ArkUI.ArkUI.Full 4041 * @crossplatform 4042 * @form 4043 * @since 10 4044 */ 4045 /** 4046 * The value of this parameter cannot be 0 or a negative number. 4047 * 4048 * @type { number } 4049 * @default 10(px) 4050 * @syscap SystemCapability.ArkUI.ArkUI.Full 4051 * @crossplatform 4052 * @form 4053 * @atomicservice 4054 * @since 11 4055 */ 4056 miterLimit: number; 4057 4058 /** 4059 * Gets the current segment style. 4060 * 4061 * @returns { number[] } 4062 * @syscap SystemCapability.ArkUI.ArkUI.Full 4063 * @since 8 4064 */ 4065 /** 4066 * Gets the current segment style. 4067 * 4068 * @returns { number[] } 4069 * @syscap SystemCapability.ArkUI.ArkUI.Full 4070 * @form 4071 * @since 9 4072 */ 4073 /** 4074 * Gets the current segment style. 4075 * 4076 * @returns { number[] } 4077 * @syscap SystemCapability.ArkUI.ArkUI.Full 4078 * @crossplatform 4079 * @form 4080 * @since 10 4081 */ 4082 /** 4083 * Gets the current segment style. 4084 * 4085 * @returns { number[] } 4086 * @syscap SystemCapability.ArkUI.ArkUI.Full 4087 * @crossplatform 4088 * @form 4089 * @atomicservice 4090 * @since 11 4091 */ 4092 getLineDash(): number[]; 4093 4094 /** 4095 * Sets the dashed line mode for line drawing. 4096 * 4097 * @param { number[] } segments - A set of numbers that describe the length of alternating drawn lines segments and 4098 * spacing (coordinate space units). 4099 * @syscap SystemCapability.ArkUI.ArkUI.Full 4100 * @since 8 4101 */ 4102 /** 4103 * Sets the dashed line mode for line drawing. 4104 * 4105 * @param { number[] } segments - A set of numbers that describe the length of alternating drawn lines segments and 4106 * spacing (coordinate space units). 4107 * @syscap SystemCapability.ArkUI.ArkUI.Full 4108 * @form 4109 * @since 9 4110 */ 4111 /** 4112 * Sets the dashed line mode for line drawing. 4113 * 4114 * @param { number[] } segments - A set of numbers that describe the length of alternating drawn lines segments and 4115 * spacing (coordinate space units). 4116 * @syscap SystemCapability.ArkUI.ArkUI.Full 4117 * @crossplatform 4118 * @form 4119 * @since 10 4120 */ 4121 /** 4122 * Sets the dashed line mode for line drawing. 4123 * 4124 * @param { number[] } segments - A set of numbers that describe the length of alternating drawn lines segments and 4125 * spacing (coordinate space units). 4126 * @syscap SystemCapability.ArkUI.ArkUI.Full 4127 * @crossplatform 4128 * @form 4129 * @atomicservice 4130 * @since 11 4131 */ 4132 setLineDash(segments: number[]): void; 4133 4134 /** 4135 * Clears the drawing content of a rectangular area. 4136 * 4137 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4138 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4139 * @param { number } w - Width of the rectangle. 4140 * @param { number } h - Height of the rectangle. 4141 * @syscap SystemCapability.ArkUI.ArkUI.Full 4142 * @since 8 4143 */ 4144 /** 4145 * Clears the drawing content of a rectangular area. 4146 * 4147 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4148 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4149 * @param { number } w - Width of the rectangle. 4150 * @param { number } h - Height of the rectangle. 4151 * @syscap SystemCapability.ArkUI.ArkUI.Full 4152 * @form 4153 * @since 9 4154 */ 4155 /** 4156 * Clears the drawing content of a rectangular area. 4157 * 4158 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4159 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4160 * @param { number } w - Width of the rectangle. 4161 * @param { number } h - Height of the rectangle. 4162 * @syscap SystemCapability.ArkUI.ArkUI.Full 4163 * @crossplatform 4164 * @form 4165 * @since 10 4166 */ 4167 /** 4168 * Clears the drawing content of a rectangular area. 4169 * 4170 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4171 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4172 * @param { number } w - Width of the rectangle. 4173 * @param { number } h - Height of the rectangle. 4174 * @syscap SystemCapability.ArkUI.ArkUI.Full 4175 * @crossplatform 4176 * @form 4177 * @atomicservice 4178 * @since 11 4179 */ 4180 clearRect(x: number, y: number, w: number, h: number): void; 4181 4182 /** 4183 * Fills a specified rectangular area 4184 * 4185 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4186 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4187 * @param { number } w - Width of the rectangle. 4188 * @param { number } h - Height of the rectangle. 4189 * @syscap SystemCapability.ArkUI.ArkUI.Full 4190 * @since 8 4191 */ 4192 /** 4193 * Fills a specified rectangular area 4194 * 4195 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4196 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4197 * @param { number } w - Width of the rectangle. 4198 * @param { number } h - Height of the rectangle. 4199 * @syscap SystemCapability.ArkUI.ArkUI.Full 4200 * @form 4201 * @since 9 4202 */ 4203 /** 4204 * Fills a specified rectangular area 4205 * 4206 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4207 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4208 * @param { number } w - Width of the rectangle. 4209 * @param { number } h - Height of the rectangle. 4210 * @syscap SystemCapability.ArkUI.ArkUI.Full 4211 * @crossplatform 4212 * @form 4213 * @since 10 4214 */ 4215 /** 4216 * Fills a specified rectangular area 4217 * 4218 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4219 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4220 * @param { number } w - Width of the rectangle. 4221 * @param { number } h - Height of the rectangle. 4222 * @syscap SystemCapability.ArkUI.ArkUI.Full 4223 * @crossplatform 4224 * @form 4225 * @atomicservice 4226 * @since 11 4227 */ 4228 fillRect(x: number, y: number, w: number, h: number): void; 4229 4230 /** 4231 * Stroke Specify Rectangular Area 4232 * 4233 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4234 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4235 * @param { number } w - Width of the rectangle. 4236 * @param { number } h - Height of the rectangle. 4237 * @syscap SystemCapability.ArkUI.ArkUI.Full 4238 * @since 8 4239 */ 4240 /** 4241 * Stroke Specify Rectangular Area 4242 * 4243 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4244 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4245 * @param { number } w - Width of the rectangle. 4246 * @param { number } h - Height of the rectangle. 4247 * @syscap SystemCapability.ArkUI.ArkUI.Full 4248 * @form 4249 * @since 9 4250 */ 4251 /** 4252 * Stroke Specify Rectangular Area 4253 * 4254 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4255 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4256 * @param { number } w - Width of the rectangle. 4257 * @param { number } h - Height of the rectangle. 4258 * @syscap SystemCapability.ArkUI.ArkUI.Full 4259 * @crossplatform 4260 * @form 4261 * @since 10 4262 */ 4263 /** 4264 * Stroke Specify Rectangular Area 4265 * 4266 * @param { number } x - The x-axis coordinate of the start point of the rectangle. 4267 * @param { number } y - The y-axis coordinate of the start point of the rectangle. 4268 * @param { number } w - Width of the rectangle. 4269 * @param { number } h - Height of the rectangle. 4270 * @syscap SystemCapability.ArkUI.ArkUI.Full 4271 * @crossplatform 4272 * @form 4273 * @atomicservice 4274 * @since 11 4275 */ 4276 strokeRect(x: number, y: number, w: number, h: number): void; 4277 4278 /** 4279 * Shadow blur radius. The value cannot be a negative number. 4280 * 4281 * @type { number } 4282 * @default 0 4283 * @syscap SystemCapability.ArkUI.ArkUI.Full 4284 * @since 8 4285 */ 4286 /** 4287 * Shadow blur radius. The value cannot be a negative number. 4288 * 4289 * @type { number } 4290 * @default 0 4291 * @syscap SystemCapability.ArkUI.ArkUI.Full 4292 * @form 4293 * @since 9 4294 */ 4295 /** 4296 * Shadow blur radius. The value cannot be a negative number. 4297 * 4298 * @type { number } 4299 * @default 0 4300 * @syscap SystemCapability.ArkUI.ArkUI.Full 4301 * @crossplatform 4302 * @form 4303 * @since 10 4304 */ 4305 /** 4306 * Shadow blur radius. The value cannot be a negative number. 4307 * 4308 * @type { number } 4309 * @default 0 4310 * @syscap SystemCapability.ArkUI.ArkUI.Full 4311 * @crossplatform 4312 * @form 4313 * @atomicservice 4314 * @since 11 4315 */ 4316 shadowBlur: number; 4317 4318 /** 4319 * Shadow color. 4320 * 4321 * @type { string } 4322 * @default transparent black 4323 * @syscap SystemCapability.ArkUI.ArkUI.Full 4324 * @since 8 4325 */ 4326 /** 4327 * Shadow color. 4328 * 4329 * @type { string } 4330 * @default transparent black 4331 * @syscap SystemCapability.ArkUI.ArkUI.Full 4332 * @form 4333 * @since 9 4334 */ 4335 /** 4336 * Shadow color. 4337 * 4338 * @type { string } 4339 * @default transparent black 4340 * @syscap SystemCapability.ArkUI.ArkUI.Full 4341 * @crossplatform 4342 * @form 4343 * @since 10 4344 */ 4345 /** 4346 * Shadow color. 4347 * 4348 * @type { string } 4349 * @default transparent black 4350 * @syscap SystemCapability.ArkUI.ArkUI.Full 4351 * @crossplatform 4352 * @form 4353 * @atomicservice 4354 * @since 11 4355 */ 4356 shadowColor: string; 4357 4358 /** 4359 * Horizontal offset distance of the shadow. 4360 * 4361 * @type { number } 4362 * @default 0 4363 * @syscap SystemCapability.ArkUI.ArkUI.Full 4364 * @since 8 4365 */ 4366 /** 4367 * Horizontal offset distance of the shadow. 4368 * 4369 * @type { number } 4370 * @default 0 4371 * @syscap SystemCapability.ArkUI.ArkUI.Full 4372 * @form 4373 * @since 9 4374 */ 4375 /** 4376 * Horizontal offset distance of the shadow. 4377 * 4378 * @type { number } 4379 * @default 0 4380 * @syscap SystemCapability.ArkUI.ArkUI.Full 4381 * @crossplatform 4382 * @form 4383 * @since 10 4384 */ 4385 /** 4386 * Horizontal offset distance of the shadow. 4387 * 4388 * @type { number } 4389 * @default 0 4390 * @syscap SystemCapability.ArkUI.ArkUI.Full 4391 * @crossplatform 4392 * @form 4393 * @atomicservice 4394 * @since 11 4395 */ 4396 shadowOffsetX: number; 4397 4398 /** 4399 * Vertical offset distance of the shadow. 4400 * 4401 * @type { number } 4402 * @default 0 4403 * @syscap SystemCapability.ArkUI.ArkUI.Full 4404 * @since 8 4405 */ 4406 /** 4407 * Vertical offset distance of the shadow. 4408 * 4409 * @type { number } 4410 * @default 0 4411 * @syscap SystemCapability.ArkUI.ArkUI.Full 4412 * @form 4413 * @since 9 4414 */ 4415 /** 4416 * Vertical offset distance of the shadow. 4417 * 4418 * @type { number } 4419 * @default 0 4420 * @syscap SystemCapability.ArkUI.ArkUI.Full 4421 * @crossplatform 4422 * @form 4423 * @since 10 4424 */ 4425 /** 4426 * Vertical offset distance of the shadow. 4427 * 4428 * @type { number } 4429 * @default 0 4430 * @syscap SystemCapability.ArkUI.ArkUI.Full 4431 * @crossplatform 4432 * @form 4433 * @atomicservice 4434 * @since 11 4435 */ 4436 shadowOffsetY: number; 4437 4438 /** 4439 * Top of the stack pop-up state in the drawing state stack 4440 * 4441 * @syscap SystemCapability.ArkUI.ArkUI.Full 4442 * @since 8 4443 */ 4444 /** 4445 * Top of the stack pop-up state in the drawing state stack 4446 * 4447 * @syscap SystemCapability.ArkUI.ArkUI.Full 4448 * @form 4449 * @since 9 4450 */ 4451 /** 4452 * Top of the stack pop-up state in the drawing state stack 4453 * 4454 * @syscap SystemCapability.ArkUI.ArkUI.Full 4455 * @crossplatform 4456 * @form 4457 * @since 10 4458 */ 4459 /** 4460 * Top of the stack pop-up state in the drawing state stack 4461 * 4462 * @syscap SystemCapability.ArkUI.ArkUI.Full 4463 * @crossplatform 4464 * @form 4465 * @atomicservice 4466 * @since 11 4467 */ 4468 restore(): void; 4469 4470 /** 4471 * Saves the current drawing state to the drawing state stack 4472 * 4473 * @syscap SystemCapability.ArkUI.ArkUI.Full 4474 * @since 8 4475 */ 4476 /** 4477 * Saves the current drawing state to the drawing state stack 4478 * 4479 * @syscap SystemCapability.ArkUI.ArkUI.Full 4480 * @form 4481 * @since 9 4482 */ 4483 /** 4484 * Saves the current drawing state to the drawing state stack 4485 * 4486 * @syscap SystemCapability.ArkUI.ArkUI.Full 4487 * @crossplatform 4488 * @form 4489 * @since 10 4490 */ 4491 /** 4492 * Saves the current drawing state to the drawing state stack 4493 * 4494 * @syscap SystemCapability.ArkUI.ArkUI.Full 4495 * @crossplatform 4496 * @form 4497 * @atomicservice 4498 * @since 11 4499 */ 4500 save(): void; 4501 4502 /** 4503 * Fills the specified text at the specified location 4504 * 4505 * @param { string } text - Text string to be drawn. 4506 * @param { number } x - The x-axis coordinate of the start point of the text. 4507 * @param { number } y - The y-axis coordinate of the start point of the text. 4508 * @param { number } maxWidth - Maximum width of the drawing. 4509 * @syscap SystemCapability.ArkUI.ArkUI.Full 4510 * @since 8 4511 */ 4512 /** 4513 * Fills the specified text at the specified location 4514 * 4515 * @param { string } text - Text string to be drawn. 4516 * @param { number } x - The x-axis coordinate of the start point of the text. 4517 * @param { number } y - The y-axis coordinate of the start point of the text. 4518 * @param { number } maxWidth - Maximum width of the drawing. 4519 * @syscap SystemCapability.ArkUI.ArkUI.Full 4520 * @form 4521 * @since 9 4522 */ 4523 /** 4524 * Fills the specified text at the specified location 4525 * 4526 * @param { string } text - Text string to be drawn. 4527 * @param { number } x - The x-axis coordinate of the start point of the text. 4528 * @param { number } y - The y-axis coordinate of the start point of the text. 4529 * @param { number } maxWidth - Maximum width of the drawing. 4530 * @syscap SystemCapability.ArkUI.ArkUI.Full 4531 * @crossplatform 4532 * @form 4533 * @since 10 4534 */ 4535 /** 4536 * Fills the specified text at the specified location 4537 * 4538 * @param { string } text - Text string to be drawn. 4539 * @param { number } x - The x-axis coordinate of the start point of the text. 4540 * @param { number } y - The y-axis coordinate of the start point of the text. 4541 * @param { number } maxWidth - Maximum width of the drawing. 4542 * @syscap SystemCapability.ArkUI.ArkUI.Full 4543 * @crossplatform 4544 * @form 4545 * @atomicservice 4546 * @since 11 4547 */ 4548 fillText(text: string, x: number, y: number, maxWidth?: number): void; 4549 4550 /** 4551 * Measure the size of a specified text. For details about the return value, see {@link TextMetrics}. 4552 * 4553 * @param { string } text - Text string to be measured. 4554 * @returns { TextMetrics } 4555 * @syscap SystemCapability.ArkUI.ArkUI.Full 4556 * @since 8 4557 */ 4558 /** 4559 * Measure the size of a specified text. For details about the return value, see {@link TextMetrics}. 4560 * 4561 * @param { string } text - Text string to be measured. 4562 * @returns { TextMetrics } 4563 * @syscap SystemCapability.ArkUI.ArkUI.Full 4564 * @form 4565 * @since 9 4566 */ 4567 /** 4568 * Measure the size of a specified text. For details about the return value, see {@link TextMetrics}. 4569 * 4570 * @param { string } text - Text string to be measured. 4571 * @returns { TextMetrics } 4572 * @syscap SystemCapability.ArkUI.ArkUI.Full 4573 * @crossplatform 4574 * @form 4575 * @since 10 4576 */ 4577 /** 4578 * Measure the size of a specified text. For details about the return value, see {@link TextMetrics}. 4579 * 4580 * @param { string } text - Text string to be measured. 4581 * @returns { TextMetrics } 4582 * @syscap SystemCapability.ArkUI.ArkUI.Full 4583 * @crossplatform 4584 * @form 4585 * @atomicservice 4586 * @since 11 4587 */ 4588 measureText(text: string): TextMetrics; 4589 4590 /** 4591 * Stroke specified text at specified position 4592 * 4593 * @param { string } text - Text string to be stroked. 4594 * @param { number } x - The x-axis coordinate of the start point of the text. 4595 * @param { number } y - The y-axis-axis coordinate of the start point of the text. 4596 * @param { number } maxWidth - Maximum width of the stroke. 4597 * @syscap SystemCapability.ArkUI.ArkUI.Full 4598 * @since 8 4599 */ 4600 /** 4601 * Stroke specified text at specified position 4602 * 4603 * @param { string } text - Text string to be stroked. 4604 * @param { number } x - The x-axis coordinate of the start point of the text. 4605 * @param { number } y - The y-axis-axis coordinate of the start point of the text. 4606 * @param { number } maxWidth - Maximum width of the stroke. 4607 * @syscap SystemCapability.ArkUI.ArkUI.Full 4608 * @form 4609 * @since 9 4610 */ 4611 /** 4612 * Stroke specified text at specified position 4613 * 4614 * @param { string } text - Text string to be stroked. 4615 * @param { number } x - The x-axis coordinate of the start point of the text. 4616 * @param { number } y - The y-axis-axis coordinate of the start point of the text. 4617 * @param { number } maxWidth - Maximum width of the stroke. 4618 * @syscap SystemCapability.ArkUI.ArkUI.Full 4619 * @crossplatform 4620 * @form 4621 * @since 10 4622 */ 4623 /** 4624 * Stroke specified text at specified position 4625 * 4626 * @param { string } text - Text string to be stroked. 4627 * @param { number } x - The x-axis coordinate of the start point of the text. 4628 * @param { number } y - The y-axis-axis coordinate of the start point of the text. 4629 * @param { number } maxWidth - Maximum width of the stroke. 4630 * @syscap SystemCapability.ArkUI.ArkUI.Full 4631 * @crossplatform 4632 * @form 4633 * @atomicservice 4634 * @since 11 4635 */ 4636 strokeText(text: string, x: number, y: number, maxWidth?: number): void; 4637 4638 /** 4639 * Text drawing direction. For details, see {@link CanvasDirection}. 4640 * 4641 * @type { CanvasDirection } 4642 * @default inherit 4643 * @syscap SystemCapability.ArkUI.ArkUI.Full 4644 * @since 8 4645 */ 4646 /** 4647 * Text drawing direction. For details, see {@link CanvasDirection}. 4648 * 4649 * @type { CanvasDirection } 4650 * @default inherit 4651 * @syscap SystemCapability.ArkUI.ArkUI.Full 4652 * @form 4653 * @since 9 4654 */ 4655 /** 4656 * Text drawing direction. For details, see {@link CanvasDirection}. 4657 * 4658 * @type { CanvasDirection } 4659 * @default inherit 4660 * @syscap SystemCapability.ArkUI.ArkUI.Full 4661 * @crossplatform 4662 * @form 4663 * @since 10 4664 */ 4665 /** 4666 * Text drawing direction. For details, see {@link CanvasDirection}. 4667 * 4668 * @type { CanvasDirection } 4669 * @default inherit 4670 * @syscap SystemCapability.ArkUI.ArkUI.Full 4671 * @crossplatform 4672 * @form 4673 * @atomicservice 4674 * @since 11 4675 */ 4676 direction: CanvasDirection; 4677 4678 /** 4679 * Font style. 4680 * 4681 * @type { string } 4682 * @default normal normal 14px sans-serif 4683 * @syscap SystemCapability.ArkUI.ArkUI.Full 4684 * @since 8 4685 */ 4686 /** 4687 * Font style. 4688 * 4689 * @type { string } 4690 * @default normal normal 14px sans-serif 4691 * @syscap SystemCapability.ArkUI.ArkUI.Full 4692 * @form 4693 * @since 9 4694 */ 4695 /** 4696 * Font style. 4697 * 4698 * @type { string } 4699 * @default normal normal 14px sans-serif 4700 * @syscap SystemCapability.ArkUI.ArkUI.Full 4701 * @crossplatform 4702 * @form 4703 * @since 10 4704 */ 4705 /** 4706 * Font style. 4707 * 4708 * @type { string } 4709 * @default normal normal 14px sans-serif 4710 * @syscap SystemCapability.ArkUI.ArkUI.Full 4711 * @crossplatform 4712 * @form 4713 * @atomicservice 4714 * @since 11 4715 */ 4716 font: string; 4717 4718 /** 4719 * Text alignment mode. For details, see {@link CanvasTextAlign}. 4720 * 4721 * @type { CanvasTextAlign } 4722 * @default start 4723 * @syscap SystemCapability.ArkUI.ArkUI.Full 4724 * @since 8 4725 */ 4726 /** 4727 * Text alignment mode. For details, see {@link CanvasTextAlign}. 4728 * 4729 * @type { CanvasTextAlign } 4730 * @default start 4731 * @syscap SystemCapability.ArkUI.ArkUI.Full 4732 * @form 4733 * @since 9 4734 */ 4735 /** 4736 * Text alignment mode. For details, see {@link CanvasTextAlign}. 4737 * 4738 * @type { CanvasTextAlign } 4739 * @default start 4740 * @syscap SystemCapability.ArkUI.ArkUI.Full 4741 * @crossplatform 4742 * @form 4743 * @since 10 4744 */ 4745 /** 4746 * Text alignment mode. For details, see {@link CanvasTextAlign}. 4747 * 4748 * @type { CanvasTextAlign } 4749 * @default start 4750 * @syscap SystemCapability.ArkUI.ArkUI.Full 4751 * @crossplatform 4752 * @form 4753 * @atomicservice 4754 * @since 11 4755 */ 4756 textAlign: CanvasTextAlign; 4757 4758 /** 4759 * Text baseline. For details, see {@link CanvasTextBaseline}. 4760 * 4761 * @type { CanvasTextBaseline } 4762 * @default alphabetic 4763 * @syscap SystemCapability.ArkUI.ArkUI.Full 4764 * @since 8 4765 */ 4766 /** 4767 * Text baseline. For details, see {@link CanvasTextBaseline}. 4768 * 4769 * @type { CanvasTextBaseline } 4770 * @default alphabetic 4771 * @syscap SystemCapability.ArkUI.ArkUI.Full 4772 * @form 4773 * @since 9 4774 */ 4775 /** 4776 * Text baseline. For details, see {@link CanvasTextBaseline}. 4777 * 4778 * @type { CanvasTextBaseline } 4779 * @default alphabetic 4780 * @syscap SystemCapability.ArkUI.ArkUI.Full 4781 * @crossplatform 4782 * @form 4783 * @since 10 4784 */ 4785 /** 4786 * Text baseline. For details, see {@link CanvasTextBaseline}. 4787 * 4788 * @type { CanvasTextBaseline } 4789 * @default alphabetic 4790 * @syscap SystemCapability.ArkUI.ArkUI.Full 4791 * @crossplatform 4792 * @form 4793 * @atomicservice 4794 * @since 11 4795 */ 4796 textBaseline: CanvasTextBaseline; 4797 4798 /** 4799 * Obtains the currently applied transformation matrix. 4800 * 4801 * @returns { Matrix2D } 4802 * @syscap SystemCapability.ArkUI.ArkUI.Full 4803 * @since 8 4804 */ 4805 /** 4806 * Obtains the currently applied transformation matrix. 4807 * 4808 * @returns { Matrix2D } 4809 * @syscap SystemCapability.ArkUI.ArkUI.Full 4810 * @form 4811 * @since 9 4812 */ 4813 /** 4814 * Obtains the currently applied transformation matrix. 4815 * 4816 * @returns { Matrix2D } 4817 * @syscap SystemCapability.ArkUI.ArkUI.Full 4818 * @crossplatform 4819 * @form 4820 * @since 10 4821 */ 4822 /** 4823 * Obtains the currently applied transformation matrix. 4824 * 4825 * @returns { Matrix2D } 4826 * @syscap SystemCapability.ArkUI.ArkUI.Full 4827 * @crossplatform 4828 * @form 4829 * @atomicservice 4830 * @since 11 4831 */ 4832 getTransform(): Matrix2D; 4833 4834 /** 4835 * Resets the current transformation matrix using the identity matrix 4836 * 4837 * @syscap SystemCapability.ArkUI.ArkUI.Full 4838 * @since 8 4839 */ 4840 /** 4841 * Resets the current transformation matrix using the identity matrix 4842 * 4843 * @syscap SystemCapability.ArkUI.ArkUI.Full 4844 * @form 4845 * @since 9 4846 */ 4847 /** 4848 * Resets the current transformation matrix using the identity matrix 4849 * 4850 * @syscap SystemCapability.ArkUI.ArkUI.Full 4851 * @crossplatform 4852 * @form 4853 * @since 10 4854 */ 4855 /** 4856 * Resets the current transformation matrix using the identity matrix 4857 * 4858 * @syscap SystemCapability.ArkUI.ArkUI.Full 4859 * @crossplatform 4860 * @form 4861 * @atomicservice 4862 * @since 11 4863 */ 4864 resetTransform(): void; 4865 4866 /** 4867 * Adds the effect of a rotation 4868 * 4869 * @param { number } angle - The radian of clockwise rotation, which can be converted to an angle value using the formula: 4870 * degree * Math.PI / 180 4871 * @syscap SystemCapability.ArkUI.ArkUI.Full 4872 * @since 8 4873 */ 4874 /** 4875 * Adds the effect of a rotation 4876 * 4877 * @param { number } angle - The radian of clockwise rotation, which can be converted to an angle value using the formula: 4878 * degree * Math.PI / 180 4879 * @syscap SystemCapability.ArkUI.ArkUI.Full 4880 * @form 4881 * @since 9 4882 */ 4883 /** 4884 * Adds the effect of a rotation 4885 * 4886 * @param { number } angle - The radian of clockwise rotation, which can be converted to an angle value using the formula: 4887 * degree * Math.PI / 180 4888 * @syscap SystemCapability.ArkUI.ArkUI.Full 4889 * @crossplatform 4890 * @form 4891 * @since 10 4892 */ 4893 /** 4894 * Adds the effect of a rotation 4895 * 4896 * @param { number } angle - The radian of clockwise rotation, which can be converted to an angle value using the formula: 4897 * degree * Math.PI / 180 4898 * @syscap SystemCapability.ArkUI.ArkUI.Full 4899 * @crossplatform 4900 * @form 4901 * @atomicservice 4902 * @since 11 4903 */ 4904 rotate(angle: number): void; 4905 4906 /** 4907 * Increases the scaling effect of the X and Y axes. 4908 * 4909 * @param { number } x - Horizontal scaling factor 4910 * @param { number } y - Vertical scaling factor 4911 * @syscap SystemCapability.ArkUI.ArkUI.Full 4912 * @since 8 4913 */ 4914 /** 4915 * Increases the scaling effect of the X and Y axes. 4916 * 4917 * @param { number } x - Horizontal scaling factor 4918 * @param { number } y - Vertical scaling factor 4919 * @syscap SystemCapability.ArkUI.ArkUI.Full 4920 * @form 4921 * @since 9 4922 */ 4923 /** 4924 * Increases the scaling effect of the X and Y axes. 4925 * 4926 * @param { number } x - Horizontal scaling factor 4927 * @param { number } y - Vertical scaling factor 4928 * @syscap SystemCapability.ArkUI.ArkUI.Full 4929 * @crossplatform 4930 * @form 4931 * @since 10 4932 */ 4933 /** 4934 * Increases the scaling effect of the X and Y axes. 4935 * 4936 * @param { number } x - Horizontal scaling factor 4937 * @param { number } y - Vertical scaling factor 4938 * @syscap SystemCapability.ArkUI.ArkUI.Full 4939 * @crossplatform 4940 * @form 4941 * @atomicservice 4942 * @since 11 4943 */ 4944 scale(x: number, y: number): void; 4945 4946 /** 4947 * Adds 2D transformation effects, including rotation, translation, and scaling. 4948 * The current transformation matrix will not be overwritten. Multiple transformations will be superimposed. 4949 * 4950 * @param { number } a - Horizontal Zoom 4951 * @param { number } b - Vertical Tilt 4952 * @param { number } c - Horizontal Tilt 4953 * @param { number } d - Vertical Zoom 4954 * @param { number } e - Horizontal movement 4955 * @param { number } f - Vertical movement 4956 * @syscap SystemCapability.ArkUI.ArkUI.Full 4957 * @since 8 4958 */ 4959 /** 4960 * Adds 2D transformation effects, including rotation, translation, and scaling. 4961 * The current transformation matrix will not be overwritten. Multiple transformations will be superimposed. 4962 * 4963 * @param { number } a - Horizontal Zoom 4964 * @param { number } b - Vertical Tilt 4965 * @param { number } c - Horizontal Tilt 4966 * @param { number } d - Vertical Zoom 4967 * @param { number } e - Horizontal movement 4968 * @param { number } f - Vertical movement 4969 * @syscap SystemCapability.ArkUI.ArkUI.Full 4970 * @form 4971 * @since 9 4972 */ 4973 /** 4974 * Adds 2D transformation effects, including rotation, translation, and scaling. 4975 * The current transformation matrix will not be overwritten. Multiple transformations will be superimposed. 4976 * 4977 * @param { number } a - Horizontal Zoom 4978 * @param { number } b - Vertical Tilt 4979 * @param { number } c - Horizontal Tilt 4980 * @param { number } d - Vertical Zoom 4981 * @param { number } e - Horizontal movement 4982 * @param { number } f - Vertical movement 4983 * @syscap SystemCapability.ArkUI.ArkUI.Full 4984 * @crossplatform 4985 * @form 4986 * @since 10 4987 */ 4988 /** 4989 * Adds 2D transformation effects, including rotation, translation, and scaling. 4990 * The current transformation matrix will not be overwritten. Multiple transformations will be superimposed. 4991 * 4992 * @param { number } a - Horizontal Zoom 4993 * @param { number } b - Vertical Tilt 4994 * @param { number } c - Horizontal Tilt 4995 * @param { number } d - Vertical Zoom 4996 * @param { number } e - Horizontal movement 4997 * @param { number } f - Vertical movement 4998 * @syscap SystemCapability.ArkUI.ArkUI.Full 4999 * @crossplatform 5000 * @form 5001 * @atomicservice 5002 * @since 11 5003 */ 5004 setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; 5005 5006 /** 5007 * The 2D transformation effect is added. The current transformation matrix is not overwritten and 5008 * the transformations are superimposed for multiple times. 5009 * 5010 * @param { Matrix2D } transform - 2D transformation matrix. For details, see {@link Matrix2D}. 5011 * @syscap SystemCapability.ArkUI.ArkUI.Full 5012 * @since 8 5013 */ 5014 /** 5015 * The 2D transformation effect is added. The current transformation matrix is not overwritten and 5016 * the transformations are superimposed for multiple times. 5017 * 5018 * @param { Matrix2D } transform - 2D transformation matrix. For details, see {@link Matrix2D}. 5019 * @syscap SystemCapability.ArkUI.ArkUI.Full 5020 * @form 5021 * @since 9 5022 */ 5023 /** 5024 * The 2D transformation effect is added. The current transformation matrix is not overwritten and 5025 * the transformations are superimposed for multiple times. 5026 * 5027 * @param { Matrix2D } transform - 2D transformation matrix. For details, see {@link Matrix2D}. 5028 * @syscap SystemCapability.ArkUI.ArkUI.Full 5029 * @crossplatform 5030 * @form 5031 * @since 10 5032 */ 5033 /** 5034 * The 2D transformation effect is added. The current transformation matrix is not overwritten and 5035 * the transformations are superimposed for multiple times. 5036 * 5037 * @param { Matrix2D } transform - 2D transformation matrix. For details, see {@link Matrix2D}. 5038 * @syscap SystemCapability.ArkUI.ArkUI.Full 5039 * @crossplatform 5040 * @form 5041 * @atomicservice 5042 * @since 11 5043 */ 5044 setTransform(transform?: Matrix2D): void; 5045 5046 /** 5047 * Adds the 2D transformation effect, including rotation, translation, and scaling, 5048 * and overwrites the current transformation matrix. 5049 * 5050 * @param { number } a - Horizontal Zoom 5051 * @param { number } b - Vertical Tilt 5052 * @param { number } c - Horizontal Tilt 5053 * @param { number } d - Vertical Zoom 5054 * @param { number } e - Horizontal movement 5055 * @param { number } f - Vertical movement 5056 * @syscap SystemCapability.ArkUI.ArkUI.Full 5057 * @since 8 5058 */ 5059 /** 5060 * Adds the 2D transformation effect, including rotation, translation, and scaling, 5061 * and overwrites the current transformation matrix. 5062 * 5063 * @param { number } a - Horizontal Zoom 5064 * @param { number } b - Vertical Tilt 5065 * @param { number } c - Horizontal Tilt 5066 * @param { number } d - Vertical Zoom 5067 * @param { number } e - Horizontal movement 5068 * @param { number } f - Vertical movement 5069 * @syscap SystemCapability.ArkUI.ArkUI.Full 5070 * @form 5071 * @since 9 5072 */ 5073 /** 5074 * Adds the 2D transformation effect, including rotation, translation, and scaling, 5075 * and overwrites the current transformation matrix. 5076 * 5077 * @param { number } a - Horizontal Zoom 5078 * @param { number } b - Vertical Tilt 5079 * @param { number } c - Horizontal Tilt 5080 * @param { number } d - Vertical Zoom 5081 * @param { number } e - Horizontal movement 5082 * @param { number } f - Vertical movement 5083 * @syscap SystemCapability.ArkUI.ArkUI.Full 5084 * @crossplatform 5085 * @form 5086 * @since 10 5087 */ 5088 /** 5089 * Adds the 2D transformation effect, including rotation, translation, and scaling, 5090 * and overwrites the current transformation matrix. 5091 * 5092 * @param { number } a - Horizontal Zoom 5093 * @param { number } b - Vertical Tilt 5094 * @param { number } c - Horizontal Tilt 5095 * @param { number } d - Vertical Zoom 5096 * @param { number } e - Horizontal movement 5097 * @param { number } f - Vertical movement 5098 * @syscap SystemCapability.ArkUI.ArkUI.Full 5099 * @crossplatform 5100 * @form 5101 * @atomicservice 5102 * @since 11 5103 */ 5104 transform(a: number, b: number, c: number, d: number, e: number, f: number): void; 5105 5106 /** 5107 * Increases the translation effect of the X and Y axes 5108 * 5109 * @param { number } x - Horizontal movement distance 5110 * @param { number } y - Vertical travel distance 5111 * @syscap SystemCapability.ArkUI.ArkUI.Full 5112 * @since 8 5113 */ 5114 /** 5115 * Increases the translation effect of the X and Y axes 5116 * 5117 * @param { number } x - Horizontal movement distance 5118 * @param { number } y - Vertical travel distance 5119 * @syscap SystemCapability.ArkUI.ArkUI.Full 5120 * @form 5121 * @since 9 5122 */ 5123 /** 5124 * Increases the translation effect of the X and Y axes 5125 * 5126 * @param { number } x - Horizontal movement distance 5127 * @param { number } y - Vertical travel distance 5128 * @syscap SystemCapability.ArkUI.ArkUI.Full 5129 * @crossplatform 5130 * @form 5131 * @since 10 5132 */ 5133 /** 5134 * Increases the translation effect of the X and Y axes 5135 * 5136 * @param { number } x - Horizontal movement distance 5137 * @param { number } y - Vertical travel distance 5138 * @syscap SystemCapability.ArkUI.ArkUI.Full 5139 * @crossplatform 5140 * @form 5141 * @atomicservice 5142 * @since 11 5143 */ 5144 translate(x: number, y: number): void; 5145 5146 /** 5147 * Set a PixelMap to the current context. The drawing content is synchronized to the PixelMap. 5148 * 5149 * @param { PixelMap } value - PixelMap object 5150 * @syscap SystemCapability.ArkUI.ArkUI.Full 5151 * @since 8 5152 */ 5153 /** 5154 * Set a PixelMap to the current context. The drawing content is synchronized to the PixelMap. 5155 * 5156 * @param { PixelMap } value - PixelMap object 5157 * @syscap SystemCapability.ArkUI.ArkUI.Full 5158 * @crossplatform 5159 * @since 10 5160 */ 5161 /** 5162 * Set a PixelMap to the current context. The drawing content is synchronized to the PixelMap. 5163 * 5164 * @param { PixelMap } value - PixelMap object 5165 * @syscap SystemCapability.ArkUI.ArkUI.Full 5166 * @crossplatform 5167 * @atomicservice 5168 * @since 11 5169 */ 5170 setPixelMap(value?: PixelMap): void; 5171 5172 /** 5173 * transfer ImageBitmap to content. 5174 * 5175 * @param { ImageBitmap } bitmap 5176 * @syscap SystemCapability.ArkUI.ArkUI.Full 5177 * @since 8 5178 */ 5179 /** 5180 * transfer ImageBitmap to content. 5181 * 5182 * @param { ImageBitmap } bitmap 5183 * @syscap SystemCapability.ArkUI.ArkUI.Full 5184 * @form 5185 * @since 9 5186 */ 5187 /** 5188 * transfer ImageBitmap to content. 5189 * 5190 * @param { ImageBitmap } bitmap 5191 * @syscap SystemCapability.ArkUI.ArkUI.Full 5192 * @crossplatform 5193 * @form 5194 * @since 10 5195 */ 5196 /** 5197 * transfer ImageBitmap to content. 5198 * 5199 * @param { ImageBitmap } bitmap 5200 * @syscap SystemCapability.ArkUI.ArkUI.Full 5201 * @crossplatform 5202 * @form 5203 * @atomicservice 5204 * @since 11 5205 */ 5206 transferFromImageBitmap(bitmap: ImageBitmap): void; 5207 5208 /** 5209 * Allocate a layer for subsequent drawing. 5210 * 5211 * @syscap SystemCapability.ArkUI.ArkUI.Full 5212 * @crossplatform 5213 * @atomicservice 5214 * @since 12 5215 */ 5216 saveLayer(): void; 5217 5218 /** 5219 * Remove changes to transform and clip since saveLayer was last called and draw the layer on canvas. 5220 * 5221 * @syscap SystemCapability.ArkUI.ArkUI.Full 5222 * @crossplatform 5223 * @atomicservice 5224 * @since 12 5225 */ 5226 restoreLayer(): void; 5227 5228 /** 5229 * Clear the backing buffer, drawing state stack, any defined paths, and styles. 5230 * 5231 * @syscap SystemCapability.ArkUI.ArkUI.Full 5232 * @crossplatform 5233 * @atomicservice 5234 * @since 12 5235 */ 5236 reset(): void; 5237} 5238 5239/** 5240 * Draw context object for the Canvas component. 5241 * 5242 * @extends CanvasRenderer 5243 * @syscap SystemCapability.ArkUI.ArkUI.Full 5244 * @since 8 5245 */ 5246/** 5247 * Draw context object for the Canvas component. 5248 * 5249 * @extends CanvasRenderer 5250 * @syscap SystemCapability.ArkUI.ArkUI.Full 5251 * @form 5252 * @since 9 5253 */ 5254/** 5255 * Draw context object for the Canvas component. 5256 * 5257 * @extends CanvasRenderer 5258 * @syscap SystemCapability.ArkUI.ArkUI.Full 5259 * @crossplatform 5260 * @form 5261 * @since 10 5262 */ 5263/** 5264 * Draw context object for the Canvas component. 5265 * 5266 * @extends CanvasRenderer 5267 * @syscap SystemCapability.ArkUI.ArkUI.Full 5268 * @crossplatform 5269 * @form 5270 * @atomicservice 5271 * @since 11 5272 */ 5273declare class CanvasRenderingContext2D extends CanvasRenderer { 5274 /** 5275 * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. 5276 * 5277 * @type { number } 5278 * @readonly 5279 * @syscap SystemCapability.ArkUI.ArkUI.Full 5280 * @since 8 5281 */ 5282 /** 5283 * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. 5284 * 5285 * @type { number } 5286 * @readonly 5287 * @syscap SystemCapability.ArkUI.ArkUI.Full 5288 * @form 5289 * @since 9 5290 */ 5291 /** 5292 * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. 5293 * 5294 * @type { number } 5295 * @readonly 5296 * @syscap SystemCapability.ArkUI.ArkUI.Full 5297 * @crossplatform 5298 * @form 5299 * @since 10 5300 */ 5301 /** 5302 * The default value is 0, which is bound to the height of the specified canvas. The value is read-only. 5303 * 5304 * @type { number } 5305 * @readonly 5306 * @syscap SystemCapability.ArkUI.ArkUI.Full 5307 * @crossplatform 5308 * @form 5309 * @atomicservice 5310 * @since 11 5311 */ 5312 readonly height: number; 5313 5314 /** 5315 * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. 5316 * 5317 * @type { number } 5318 * @readonly 5319 * @syscap SystemCapability.ArkUI.ArkUI.Full 5320 * @since 8 5321 */ 5322 /** 5323 * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. 5324 * 5325 * @type { number } 5326 * @readonly 5327 * @syscap SystemCapability.ArkUI.ArkUI.Full 5328 * @form 5329 * @since 9 5330 */ 5331 /** 5332 * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. 5333 * 5334 * @type { number } 5335 * @readonly 5336 * @syscap SystemCapability.ArkUI.ArkUI.Full 5337 * @crossplatform 5338 * @form 5339 * @since 10 5340 */ 5341 /** 5342 * The default value is 0, which is bound to the width of the specified canvas. The value is read-only. 5343 * 5344 * @type { number } 5345 * @readonly 5346 * @syscap SystemCapability.ArkUI.ArkUI.Full 5347 * @crossplatform 5348 * @form 5349 * @atomicservice 5350 * @since 11 5351 */ 5352 readonly width: number; 5353 5354 /** 5355 * Frame node of the canvas. The default value is null. 5356 * 5357 * @type { FrameNode } 5358 * @readonly 5359 * @syscap SystemCapability.ArkUI.ArkUI.Full 5360 * @crossplatform 5361 * @atomicservice 5362 * @since 13 5363 */ 5364 readonly canvas: FrameNode; 5365 5366 /** 5367 * Generate a character string in the data url format. 5368 * 5369 * @param { string } type - Image format. The default value is image/png. 5370 * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. 5371 * If the value is out of the range, the default value 0.92 is used. 5372 * @returns { string } 5373 * @syscap SystemCapability.ArkUI.ArkUI.Full 5374 * @since 8 5375 */ 5376 /** 5377 * Generate a character string in the data url format. 5378 * 5379 * @param { string } type - Image format. The default value is image/png. 5380 * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. 5381 * If the value is out of the range, the default value 0.92 is used. 5382 * @returns { string } 5383 * @syscap SystemCapability.ArkUI.ArkUI.Full 5384 * @form 5385 * @since 9 5386 */ 5387 /** 5388 * Generate a character string in the data url format. 5389 * 5390 * @param { string } type - Image format. The default value is image/png. 5391 * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. 5392 * If the value is out of the range, the default value 0.92 is used. 5393 * @returns { string } 5394 * @syscap SystemCapability.ArkUI.ArkUI.Full 5395 * @crossplatform 5396 * @form 5397 * @since 10 5398 */ 5399 /** 5400 * Generate a character string in the data url format. 5401 * 5402 * @param { string } type - Image format. The default value is image/png. 5403 * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. 5404 * If the value is out of the range, the default value 0.92 is used. 5405 * @returns { string } 5406 * @syscap SystemCapability.ArkUI.ArkUI.Full 5407 * @crossplatform 5408 * @form 5409 * @atomicservice 5410 * @since 11 5411 */ 5412 toDataURL(type?: string, quality?: any): string; 5413 5414 /** 5415 * Start image analyzer. 5416 * 5417 * @param { ImageAnalyzerConfig } config - Image analyzer config. 5418 * @returns { Promise<void> } The promise returned by the function. 5419 * @throws { BusinessError } 110001 - Image analysis feature is not supported. 5420 * @throws { BusinessError } 110002 - Image analysis is currently being executed. 5421 * @syscap SystemCapability.ArkUI.ArkUI.Full 5422 * @atomicservice 5423 * @since 12 5424 */ 5425 startImageAnalyzer(config: ImageAnalyzerConfig): Promise<void>; 5426 5427 /** 5428 * Stop image analyzer. 5429 * @syscap SystemCapability.ArkUI.ArkUI.Full 5430 * @atomicservice 5431 * @since 12 5432 */ 5433 stopImageAnalyzer(): void; 5434 5435 /** 5436 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5437 * 5438 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5439 * @syscap SystemCapability.ArkUI.ArkUI.Full 5440 * @since 8 5441 */ 5442 /** 5443 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5444 * 5445 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5446 * @syscap SystemCapability.ArkUI.ArkUI.Full 5447 * @form 5448 * @since 9 5449 */ 5450 /** 5451 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5452 * 5453 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5454 * @syscap SystemCapability.ArkUI.ArkUI.Full 5455 * @crossplatform 5456 * @form 5457 * @since 10 5458 */ 5459 /** 5460 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5461 * 5462 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5463 * @syscap SystemCapability.ArkUI.ArkUI.Full 5464 * @crossplatform 5465 * @form 5466 * @atomicservice 5467 * @since 11 5468 */ 5469 constructor(settings?: RenderingContextSettings); 5470 5471 /** 5472 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5473 * 5474 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5475 * @param { LengthMetricsUnit } [unit] - the unit mode 5476 * @syscap SystemCapability.ArkUI.ArkUI.Full 5477 * @crossplatform 5478 * @form 5479 * @atomicservice 5480 * @since 12 5481 */ 5482 constructor(settings?: RenderingContextSettings, unit?: LengthMetricsUnit); 5483 5484 /** 5485 * Register the listener that watches if the canvasrenderingcontext2d attached to the Canvas frameNode. 5486 * 5487 * @param { 'onAttach' } type Indicates the type of event. 5488 * @param { Callback<void> } callback Indicates the listener. 5489 * @throws { BusinessError } 401 - Input parameter error. Possible causes: 5490 * 1. Mandatory parameters are left unspecified; 5491 * 2. Incorrect parameter types; 5492 * 3. Parameter verification failed. 5493 * @syscap SystemCapability.ArkUI.ArkUI.Full 5494 * @crossplatform 5495 * @atomicservice 5496 * @since 13 5497 */ 5498 on(type: 'onAttach', callback: Callback<void>): void; 5499 5500 /** 5501 * Unregister the listener that watches if the canvasrenderingcontext2d attached to the Canvas frameNode. 5502 * 5503 * @param { 'onAttach' } type Indicates the type of event. 5504 * @param { Callback<void> } callback Indicates the listener. 5505 * @throws { BusinessError } 401 - Input parameter error. Possible causes: 5506 * 1. Mandatory parameters are left unspecified; 5507 * 2. Incorrect parameter types; 5508 * 3. Parameter verification failed. 5509 * @syscap SystemCapability.ArkUI.ArkUI.Full 5510 * @crossplatform 5511 * @atomicservice 5512 * @since 13 5513 */ 5514 off(type: 'onAttach', callback?: Callback<void>): void; 5515 5516 /** 5517 * Register the listener that watches if the canvasrenderingcontext2d detached from the Canvas frameNode. 5518 * 5519 * @param { 'onDetach' } type Indicates the type of event. 5520 * @param { Callback<void> } callback Indicates the listener. 5521 * @throws { BusinessError } 401 - Input parameter error. Possible causes: 5522 * 1. Mandatory parameters are left unspecified; 5523 * 2. Incorrect parameter types; 5524 * 3. Parameter verification failed. 5525 * @syscap SystemCapability.ArkUI.ArkUI.Full 5526 * @crossplatform 5527 * @atomicservice 5528 * @since 13 5529 */ 5530 on(type: 'onDetach', callback: Callback<void>): void; 5531 5532 /** 5533 * Unregister the listener that watches if the canvasrenderingcontext2d detached from the Canvas frameNode. 5534 * 5535 * @param { 'onDetach' } type Indicates the type of event. 5536 * @param { Callback<void> } callback Indicates the listener. 5537 * @throws { BusinessError } 401 - Input parameter error. Possible causes: 5538 * 1. Mandatory parameters are left unspecified; 5539 * 2. Incorrect parameter types; 5540 * 3. Parameter verification failed. 5541 * @syscap SystemCapability.ArkUI.ArkUI.Full 5542 * @crossplatform 5543 * @atomicservice 5544 * @since 13 5545 */ 5546 off(type: 'onDetach', callback?: Callback<void>): void; 5547} 5548 5549/** 5550 * Draw context object for the OffscreenCanvas component. 5551 * 5552 * @extends CanvasRenderer 5553 * @syscap SystemCapability.ArkUI.ArkUI.Full 5554 * @since 8 5555 */ 5556/** 5557 * Draw context object for the OffscreenCanvas component. 5558 * 5559 * @extends CanvasRenderer 5560 * @syscap SystemCapability.ArkUI.ArkUI.Full 5561 * @form 5562 * @since 9 5563 */ 5564/** 5565 * Draw context object for the OffscreenCanvas component. 5566 * 5567 * @extends CanvasRenderer 5568 * @syscap SystemCapability.ArkUI.ArkUI.Full 5569 * @crossplatform 5570 * @form 5571 * @since 10 5572 */ 5573/** 5574 * Draw context object for the OffscreenCanvas component. 5575 * 5576 * @extends CanvasRenderer 5577 * @syscap SystemCapability.ArkUI.ArkUI.Full 5578 * @crossplatform 5579 * @form 5580 * @atomicservice 5581 * @since 11 5582 */ 5583declare class OffscreenCanvasRenderingContext2D extends CanvasRenderer { 5584 /** 5585 * Generate a character string in the data url format. 5586 * 5587 * @param { string } type - Image format. The default value is image/png. 5588 * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. 5589 * If the value is out of the range, the default value 0.92 is used. 5590 * @returns { string } 5591 * @syscap SystemCapability.ArkUI.ArkUI.Full 5592 * @since 8 5593 */ 5594 /** 5595 * Generate a character string in the data url format. 5596 * 5597 * @param { string } type - Image format. The default value is image/png. 5598 * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. 5599 * If the value is out of the range, the default value 0.92 is used. 5600 * @returns { string } 5601 * @syscap SystemCapability.ArkUI.ArkUI.Full 5602 * @form 5603 * @since 9 5604 */ 5605 /** 5606 * Generate a character string in the data url format. 5607 * 5608 * @param { string } type - Image format. The default value is image/png. 5609 * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. 5610 * If the value is out of the range, the default value 0.92 is used. 5611 * @returns { string } 5612 * @syscap SystemCapability.ArkUI.ArkUI.Full 5613 * @crossplatform 5614 * @form 5615 * @since 10 5616 */ 5617 /** 5618 * Generate a character string in the data url format. 5619 * 5620 * @param { string } type - Image format. The default value is image/png. 5621 * @param { any } quality - If the image format is image/jpeg or image/webp, you can select the image quality from 0 to 1. 5622 * If the value is out of the range, the default value 0.92 is used. 5623 * @returns { string } 5624 * @syscap SystemCapability.ArkUI.ArkUI.Full 5625 * @crossplatform 5626 * @form 5627 * @atomicservice 5628 * @since 11 5629 */ 5630 toDataURL(type?: string, quality?: any): string; 5631 5632 /** 5633 * transfer the content to ImageBitmap 5634 * 5635 * @returns { ImageBitmap } 5636 * @syscap SystemCapability.ArkUI.ArkUI.Full 5637 * @since 8 5638 */ 5639 /** 5640 * transfer the content to ImageBitmap 5641 * 5642 * @returns { ImageBitmap } 5643 * @syscap SystemCapability.ArkUI.ArkUI.Full 5644 * @form 5645 * @since 9 5646 */ 5647 /** 5648 * transfer the content to ImageBitmap 5649 * 5650 * @returns { ImageBitmap } 5651 * @syscap SystemCapability.ArkUI.ArkUI.Full 5652 * @crossplatform 5653 * @form 5654 * @since 10 5655 */ 5656 /** 5657 * transfer the content to ImageBitmap 5658 * 5659 * @returns { ImageBitmap } 5660 * @syscap SystemCapability.ArkUI.ArkUI.Full 5661 * @crossplatform 5662 * @form 5663 * @atomicservice 5664 * @since 11 5665 */ 5666 transferToImageBitmap(): ImageBitmap; 5667 5668 /** 5669 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5670 * 5671 * @param { number } width - the width of the OffscreenCanvas 5672 * @param { number } height - the height of the OffscreenCanvas 5673 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5674 * @syscap SystemCapability.ArkUI.ArkUI.Full 5675 * @since 8 5676 */ 5677 /** 5678 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5679 * 5680 * @param { number } width - the width of the OffscreenCanvas 5681 * @param { number } height - the height of the OffscreenCanvas 5682 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5683 * @syscap SystemCapability.ArkUI.ArkUI.Full 5684 * @form 5685 * @since 9 5686 */ 5687 /** 5688 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5689 * 5690 * @param { number } width - the width of the OffscreenCanvas 5691 * @param { number } height - the height of the OffscreenCanvas 5692 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5693 * @syscap SystemCapability.ArkUI.ArkUI.Full 5694 * @crossplatform 5695 * @form 5696 * @since 10 5697 */ 5698 /** 5699 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5700 * 5701 * @param { number } width - the width of the OffscreenCanvas 5702 * @param { number } height - the height of the OffscreenCanvas 5703 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5704 * @syscap SystemCapability.ArkUI.ArkUI.Full 5705 * @crossplatform 5706 * @form 5707 * @atomicservice 5708 * @since 11 5709 */ 5710 constructor(width: number, height: number, settings?: RenderingContextSettings); 5711 5712 /** 5713 * Constructor of the canvas drawing context object, which is used to create a drawing context object. 5714 * 5715 * @param { number } width - the width of the OffscreenCanvas 5716 * @param { number } height - the height of the OffscreenCanvas 5717 * @param { RenderingContextSettings } settings - Drawing attribute. For details, see {@link RenderingContextSettings}. 5718 * @param { LengthMetricsUnit } [unit] - the unit mode 5719 * @syscap SystemCapability.ArkUI.ArkUI.Full 5720 * @crossplatform 5721 * @form 5722 * @atomicservice 5723 * @since 12 5724 */ 5725 constructor(width: number, height: number, settings?: RenderingContextSettings, unit?: LengthMetricsUnit); 5726} 5727 5728/** 5729 * Draw an object off the screen. The drawing content is not directly displayed on the screen. 5730 * 5731 * @extends CanvasRenderer 5732 * @syscap SystemCapability.ArkUI.ArkUI.Full 5733 * @since 8 5734 */ 5735/** 5736 * Draw an object off the screen. The drawing content is not directly displayed on the screen. 5737 * 5738 * @extends CanvasRenderer 5739 * @syscap SystemCapability.ArkUI.ArkUI.Full 5740 * @form 5741 * @since 9 5742 */ 5743/** 5744 * Draw an object off the screen. The drawing content is not directly displayed on the screen. 5745 * 5746 * @extends CanvasRenderer 5747 * @syscap SystemCapability.ArkUI.ArkUI.Full 5748 * @crossplatform 5749 * @form 5750 * @since 10 5751 */ 5752/** 5753 * Draw an object off the screen. The drawing content is not directly displayed on the screen. 5754 * 5755 * @syscap SystemCapability.ArkUI.ArkUI.Full 5756 * @crossplatform 5757 * @form 5758 * @atomicservice 5759 * @since 11 5760 */ 5761declare class OffscreenCanvas { 5762 /** 5763 * Height of the off-screen canvas. 5764 * 5765 * @type { number } 5766 * @syscap SystemCapability.ArkUI.ArkUI.Full 5767 * @since 8 5768 */ 5769 /** 5770 * Height of the off-screen canvas. 5771 * 5772 * @type { number } 5773 * @syscap SystemCapability.ArkUI.ArkUI.Full 5774 * @form 5775 * @since 9 5776 */ 5777 /** 5778 * Height of the off-screen canvas. 5779 * 5780 * @type { number } 5781 * @syscap SystemCapability.ArkUI.ArkUI.Full 5782 * @crossplatform 5783 * @form 5784 * @since 10 5785 */ 5786 /** 5787 * Height of the off-screen canvas. 5788 * 5789 * @type { number } 5790 * @syscap SystemCapability.ArkUI.ArkUI.Full 5791 * @crossplatform 5792 * @form 5793 * @atomicservice 5794 * @since 11 5795 */ 5796 height: number; 5797 5798 /** 5799 * Width of the off-screen canvas. 5800 * 5801 * @type { number } 5802 * @syscap SystemCapability.ArkUI.ArkUI.Full 5803 * @since 8 5804 */ 5805 /** 5806 * Width of the off-screen canvas. 5807 * 5808 * @type { number } 5809 * @syscap SystemCapability.ArkUI.ArkUI.Full 5810 * @form 5811 * @since 9 5812 */ 5813 /** 5814 * Width of the off-screen canvas. 5815 * 5816 * @type { number } 5817 * @syscap SystemCapability.ArkUI.ArkUI.Full 5818 * @crossplatform 5819 * @form 5820 * @since 10 5821 */ 5822 /** 5823 * Width of the off-screen canvas. 5824 * 5825 * @type { number } 5826 * @syscap SystemCapability.ArkUI.ArkUI.Full 5827 * @crossplatform 5828 * @form 5829 * @atomicservice 5830 * @since 11 5831 */ 5832 width: number; 5833 5834 /** 5835 * Exports rendered content as an ImageBitmap object 5836 * 5837 * @returns { ImageBitmap } 5838 * @syscap SystemCapability.ArkUI.ArkUI.Full 5839 * @since 8 5840 */ 5841 /** 5842 * Exports rendered content as an ImageBitmap object 5843 * 5844 * @returns { ImageBitmap } 5845 * @syscap SystemCapability.ArkUI.ArkUI.Full 5846 * @form 5847 * @since 9 5848 */ 5849 /** 5850 * Exports rendered content as an ImageBitmap object 5851 * 5852 * @returns { ImageBitmap } 5853 * @syscap SystemCapability.ArkUI.ArkUI.Full 5854 * @crossplatform 5855 * @form 5856 * @since 10 5857 */ 5858 /** 5859 * Exports rendered content as an ImageBitmap object 5860 * 5861 * @returns { ImageBitmap } 5862 * @syscap SystemCapability.ArkUI.ArkUI.Full 5863 * @crossplatform 5864 * @form 5865 * @atomicservice 5866 * @since 11 5867 */ 5868 transferToImageBitmap(): ImageBitmap; 5869 5870 /** 5871 * Creates the context from the current OffscreenCanvas. 5872 * 5873 * @param { "2d" } contextType - The context type, only "2d" be supported now. 5874 * "2d": Creates a {@link OffscreenCanvasRenderingContext2D} object representing a two-dimensional rendering context. 5875 * @param { RenderingContextSettings } options - Drawing attribute. For details, see {@link RenderingContextSettings}. 5876 * @returns { OffscreenCanvasRenderingContext2D } The rendering context of offscreen canvas, see {@link OffscreenCanvasRenderingContext2D}. 5877 * @syscap SystemCapability.ArkUI.ArkUI.Full 5878 * @crossplatform 5879 * @since 10 5880 */ 5881 /** 5882 * Creates the context from the current OffscreenCanvas. 5883 * 5884 * @param { "2d" } contextType - The context type, only "2d" be supported now. 5885 * "2d": Creates a {@link OffscreenCanvasRenderingContext2D} object representing a two-dimensional rendering context. 5886 * @param { RenderingContextSettings } options - Drawing attribute. For details, see {@link RenderingContextSettings}. 5887 * @returns { OffscreenCanvasRenderingContext2D } The rendering context of offscreen canvas, see {@link OffscreenCanvasRenderingContext2D}. 5888 * @syscap SystemCapability.ArkUI.ArkUI.Full 5889 * @crossplatform 5890 * @atomicservice 5891 * @since 11 5892 */ 5893 getContext(contextType: "2d", options?: RenderingContextSettings): OffscreenCanvasRenderingContext2D; 5894 5895 /** 5896 * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. 5897 * 5898 * @param { number } width - Width of the off-screen canvas. 5899 * @param { number } height - Height of the off-screen canvas. 5900 * @syscap SystemCapability.ArkUI.ArkUI.Full 5901 * @since 8 5902 */ 5903 /** 5904 * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. 5905 * 5906 * @param { number } width - Width of the off-screen canvas. 5907 * @param { number } height - Height of the off-screen canvas. 5908 * @syscap SystemCapability.ArkUI.ArkUI.Full 5909 * @form 5910 * @since 9 5911 */ 5912 /** 5913 * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. 5914 * 5915 * @param { number } width - Width of the off-screen canvas. 5916 * @param { number } height - Height of the off-screen canvas. 5917 * @syscap SystemCapability.ArkUI.ArkUI.Full 5918 * @crossplatform 5919 * @form 5920 * @since 10 5921 */ 5922 /** 5923 * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. 5924 * 5925 * @param { number } width - Width of the off-screen canvas. 5926 * @param { number } height - Height of the off-screen canvas. 5927 * @syscap SystemCapability.ArkUI.ArkUI.Full 5928 * @crossplatform 5929 * @form 5930 * @atomicservice 5931 * @since 11 5932 */ 5933 constructor(width: number, height: number); 5934 5935 /** 5936 * Constructor of the off-screen canvas, which is used to create an off-screen canvas object. 5937 * 5938 * @param { number } width - Width of the off-screen canvas. 5939 * @param { number } height - Height of the off-screen canvas. 5940 * @param { LengthMetricsUnit } [unit] - the unit mode 5941 * @syscap SystemCapability.ArkUI.ArkUI.Full 5942 * @crossplatform 5943 * @form 5944 * @atomicservice 5945 * @since 12 5946 */ 5947 constructor(width: number, height: number, unit: LengthMetricsUnit); 5948} 5949 5950/** 5951 * Size info. 5952 * 5953 * @interface Size 5954 * @syscap SystemCapability.ArkUI.ArkUI.Full 5955 * @crossplatform 5956 * @atomicservice 5957 * @since 12 5958 */ 5959declare interface Size { 5960 /** 5961 * Defines the width property. 5962 * 5963 * @type { number } 5964 * @syscap SystemCapability.ArkUI.ArkUI.Full 5965 * @crossplatform 5966 * @atomicservice 5967 * @since 12 5968 */ 5969 width: number; 5970 5971 /** 5972 * Defines the height property. 5973 * 5974 * @type { number } 5975 * @syscap SystemCapability.ArkUI.ArkUI.Full 5976 * @crossplatform 5977 * @atomicservice 5978 * @since 12 5979 */ 5980 height: number; 5981} 5982 5983/** 5984 * Defines DrawingRenderingContext. 5985 * 5986 * @syscap SystemCapability.ArkUI.ArkUI.Full 5987 * @crossplatform 5988 * @atomicservice 5989 * @since 12 5990 */ 5991declare class DrawingRenderingContext { 5992 5993 /** 5994 * Get size of the DrawingRenderingContext. 5995 * 5996 * @returns { Size } The size of the DrawingRenderingContext. 5997 * @syscap SystemCapability.ArkUI.ArkUI.Full 5998 * @crossplatform 5999 * @atomicservice 6000 * @since 12 6001 */ 6002 get size(): Size; 6003 6004 /** 6005 * Get canvas of the DrawingRenderingContext. 6006 * 6007 * @returns { DrawingCanvas } The canvas of the DrawingRenderingContext. 6008 * @syscap SystemCapability.ArkUI.ArkUI.Full 6009 * @crossplatform 6010 * @atomicservice 6011 * @since 12 6012 */ 6013 get canvas(): DrawingCanvas; 6014 6015 /** 6016 * Invalidate the component, which will cause a re-render of the component. 6017 * 6018 * @syscap SystemCapability.ArkUI.ArkUI.Full 6019 * @crossplatform 6020 * @atomicservice 6021 * @since 12 6022 */ 6023 invalidate(): void; 6024 6025 /** 6026 * Create DrawingRenderingContext with setting LengthMetricsUnit. 6027 * 6028 * @param { LengthMetricsUnit } [unit] - the unit mode 6029 * @syscap SystemCapability.ArkUI.ArkUI.Full 6030 * @crossplatform 6031 * @atomicservice 6032 * @since 12 6033 */ 6034 constructor(unit?: LengthMetricsUnit); 6035} 6036 6037/** 6038 *TextTimer component, which provides the text timer capability. 6039 * 6040 * @interface CanvasInterface 6041 * @syscap SystemCapability.ArkUI.ArkUI.Full 6042 * @since 8 6043 */ 6044/** 6045 *TextTimer component, which provides the text timer capability. 6046 * 6047 * @interface CanvasInterface 6048 * @syscap SystemCapability.ArkUI.ArkUI.Full 6049 * @form 6050 * @since 9 6051 */ 6052/** 6053 *TextTimer component, which provides the text timer capability. 6054 * 6055 * @interface CanvasInterface 6056 * @syscap SystemCapability.ArkUI.ArkUI.Full 6057 * @crossplatform 6058 * @form 6059 * @since 10 6060 */ 6061/** 6062 *TextTimer component, which provides the text timer capability. 6063 * 6064 * @interface CanvasInterface 6065 * @syscap SystemCapability.ArkUI.ArkUI.Full 6066 * @crossplatform 6067 * @form 6068 * @atomicservice 6069 * @since 11 6070 */ 6071interface CanvasInterface { 6072 /** 6073 * Construct a canvas component. 6074 * 6075 * @param { CanvasRenderingContext2D } context - Canvas context object. For details, see {@link CanvasRenderingContext2D}. 6076 * @returns { CanvasAttribute } 6077 * @syscap SystemCapability.ArkUI.ArkUI.Full 6078 * @since 8 6079 */ 6080 /** 6081 * Construct a canvas component. 6082 * 6083 * @param { CanvasRenderingContext2D } context - Canvas context object. For details, see {@link CanvasRenderingContext2D}. 6084 * @returns { CanvasAttribute } 6085 * @syscap SystemCapability.ArkUI.ArkUI.Full 6086 * @form 6087 * @since 9 6088 */ 6089 /** 6090 * Construct a canvas component. 6091 * 6092 * @param { CanvasRenderingContext2D } context - Canvas context object. For details, see {@link CanvasRenderingContext2D}. 6093 * @returns { CanvasAttribute } 6094 * @syscap SystemCapability.ArkUI.ArkUI.Full 6095 * @crossplatform 6096 * @form 6097 * @since 10 6098 */ 6099 /** 6100 * Construct a canvas component. 6101 * 6102 * @param { CanvasRenderingContext2D } context - Canvas context object. For details, see {@link CanvasRenderingContext2D}. 6103 * @returns { CanvasAttribute } 6104 * @syscap SystemCapability.ArkUI.ArkUI.Full 6105 * @crossplatform 6106 * @form 6107 * @atomicservice 6108 * @since 11 6109 */ 6110 /** 6111 * Construct a canvas component. 6112 * 6113 * @param { CanvasRenderingContext2D | DrawingRenderingContext } context - Canvas context object. 6114 * @returns { CanvasAttribute } 6115 * @syscap SystemCapability.ArkUI.ArkUI.Full 6116 * @crossplatform 6117 * @form 6118 * @atomicservice 6119 * @since 12 6120 */ 6121 (context?: CanvasRenderingContext2D | DrawingRenderingContext): CanvasAttribute; 6122 6123 /** 6124 * Construct a canvas component. 6125 * 6126 * @param { CanvasRenderingContext2D | DrawingRenderingContext } context - Canvas context object. 6127 * @param { ImageAIOptions } imageAIOptions 6128 * @returns { CanvasAttribute } 6129 * @syscap SystemCapability.ArkUI.ArkUI.Full 6130 * @atomicservice 6131 * @since 12 6132 */ 6133 (context: CanvasRenderingContext2D | DrawingRenderingContext, imageAIOptions: ImageAIOptions): CanvasAttribute; 6134} 6135 6136/** 6137 * Provides attribute for Canvas. 6138 * 6139 * @extends CommonMethod<CanvasAttribute> 6140 * @syscap SystemCapability.ArkUI.ArkUI.Full 6141 * @since 8 6142 */ 6143/** 6144 * Provides attribute for Canvas. 6145 * 6146 * @extends CommonMethod<CanvasAttribute> 6147 * @syscap SystemCapability.ArkUI.ArkUI.Full 6148 * @form 6149 * @since 9 6150 */ 6151/** 6152 * Provides attribute for Canvas. 6153 * 6154 * @extends CommonMethod<CanvasAttribute> 6155 * @syscap SystemCapability.ArkUI.ArkUI.Full 6156 * @crossplatform 6157 * @form 6158 * @since 10 6159 */ 6160/** 6161 * Provides attribute for Canvas. 6162 * 6163 * @extends CommonMethod<CanvasAttribute> 6164 * @syscap SystemCapability.ArkUI.ArkUI.Full 6165 * @crossplatform 6166 * @form 6167 * @atomicservice 6168 * @since 11 6169 */ 6170declare class CanvasAttribute extends CommonMethod<CanvasAttribute> { 6171 /** 6172 * Event notification after the canvas component is constructed. You can draw the canvas at this time. 6173 * 6174 * @param { function } event 6175 * @returns { CanvasAttribute } 6176 * @syscap SystemCapability.ArkUI.ArkUI.Full 6177 * @since 8 6178 */ 6179 /** 6180 * Event notification after the canvas component is constructed. You can draw the canvas at this time. 6181 * 6182 * @param { function } event 6183 * @returns { CanvasAttribute } 6184 * @syscap SystemCapability.ArkUI.ArkUI.Full 6185 * @form 6186 * @since 9 6187 */ 6188 /** 6189 * Event notification after the canvas component is constructed. You can draw the canvas at this time. 6190 * 6191 * @param { function } event 6192 * @returns { CanvasAttribute } 6193 * @syscap SystemCapability.ArkUI.ArkUI.Full 6194 * @crossplatform 6195 * @form 6196 * @since 10 6197 */ 6198 /** 6199 * Event notification after the canvas component is constructed. You can draw the canvas at this time. 6200 * 6201 * @param { function } event 6202 * @returns { CanvasAttribute } 6203 * @syscap SystemCapability.ArkUI.ArkUI.Full 6204 * @crossplatform 6205 * @form 6206 * @atomicservice 6207 * @since 11 6208 */ 6209 /** 6210 * Event notification after the canvas component is constructed. You can draw the canvas at this time. 6211 * 6212 * @param { VoidCallback } event 6213 * @returns { CanvasAttribute } 6214 * @syscap SystemCapability.ArkUI.ArkUI.Full 6215 * @crossplatform 6216 * @form 6217 * @atomicservice 6218 * @since 18 6219 */ 6220 onReady(event: VoidCallback): CanvasAttribute; 6221 6222 /** 6223 * Enable image analyzer for Canvas. 6224 * 6225 * @param { boolean } enable - If enable image analyzer for Canvas. The default value is false. 6226 * @returns { CanvasAttribute } 6227 * @syscap SystemCapability.ArkUI.ArkUI.Full 6228 * @atomicservice 6229 * @since 12 6230 */ 6231 enableAnalyzer(enable: boolean): CanvasAttribute; 6232} 6233 6234/** 6235 * Defines Canvas Component. 6236 * 6237 * @syscap SystemCapability.ArkUI.ArkUI.Full 6238 * @since 8 6239 */ 6240/** 6241 * Defines Canvas Component. 6242 * 6243 * @syscap SystemCapability.ArkUI.ArkUI.Full 6244 * @form 6245 * @since 9 6246 */ 6247/** 6248 * Defines Canvas Component. 6249 * 6250 * @syscap SystemCapability.ArkUI.ArkUI.Full 6251 * @crossplatform 6252 * @form 6253 * @since 10 6254 */ 6255/** 6256 * Defines Canvas Component. 6257 * 6258 * @syscap SystemCapability.ArkUI.ArkUI.Full 6259 * @crossplatform 6260 * @form 6261 * @atomicservice 6262 * @since 11 6263 */ 6264declare const Canvas: CanvasInterface; 6265 6266/** 6267 * Defines Canvas Component instance. 6268 * 6269 * @syscap SystemCapability.ArkUI.ArkUI.Full 6270 * @since 8 6271 */ 6272/** 6273 * Defines Canvas Component instance. 6274 * 6275 * @syscap SystemCapability.ArkUI.ArkUI.Full 6276 * @form 6277 * @since 9 6278 */ 6279/** 6280 * Defines Canvas Component instance. 6281 * 6282 * @syscap SystemCapability.ArkUI.ArkUI.Full 6283 * @crossplatform 6284 * @form 6285 * @since 10 6286 */ 6287/** 6288 * Defines Canvas Component instance. 6289 * 6290 * @syscap SystemCapability.ArkUI.ArkUI.Full 6291 * @crossplatform 6292 * @form 6293 * @atomicservice 6294 * @since 11 6295 */ 6296declare const CanvasInstance: CanvasAttribute; 6297