canvasrenderingcontext2d.md 25.8 KB
Newer Older
1 2 3 4
## CanvasRenderingContext2D

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.description -->

W
wanganxp 已提交
5 6
参考:[canvas组件](../component/canvas.md)

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.extends -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.param -->



<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.example -->

### CanvasRenderingContext2D 的方法 @canvasrenderingcontext2d-methods
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arc.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arc.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arc.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arc.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arc.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arc.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arcTo.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arcTo.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arcTo.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arcTo.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arcTo.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.arcTo.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.beginPath.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.beginPath.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.beginPath.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.beginPath.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.beginPath.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.beginPath.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.bezierCurveTo.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.bezierCurveTo.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.bezierCurveTo.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.bezierCurveTo.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.bezierCurveTo.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.bezierCurveTo.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clearRect.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clearRect.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clearRect.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clearRect.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clearRect.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clearRect.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip.tutorial -->

D
DCloud_LXH 已提交
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_1.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_1.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_1.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_1.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_1.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_1.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_2.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_2.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_2.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_2.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_2.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_2.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_3.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_3.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_3.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_3.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_3.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.clip_3.tutorial -->

126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.closePath.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.closePath.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.closePath.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.closePath.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.closePath.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.closePath.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createImageData.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createImageData.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createImageData.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createImageData.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createImageData.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createImageData.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createPattern.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createPattern.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createPattern.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createPattern.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createPattern.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createPattern.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createLinearGradient.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createLinearGradient.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createLinearGradient.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createLinearGradient.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createLinearGradient.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createLinearGradient.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createRadialGradient.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createRadialGradient.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createRadialGradient.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createRadialGradient.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createRadialGradient.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.createRadialGradient.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.draw.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.draw.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.draw.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.draw.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.draw.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.draw.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage.tutorial -->

D
DCloud_LXH 已提交
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_1.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_1.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_1.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_1.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_1.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_1.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_2.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_2.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_2.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_2.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_2.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.drawImage_2.tutorial -->

234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.ellipse.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.ellipse.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.ellipse.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.ellipse.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.ellipse.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.ellipse.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill.tutorial -->

D
DCloud_LXH 已提交
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_1.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_1.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_1.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_1.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_1.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_1.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_2.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_2.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_2.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_2.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_2.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_2.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_3.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_3.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_3.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_3.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_3.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fill_3.tutorial -->

294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillRect.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillRect.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillRect.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillRect.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillRect.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillRect.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillText.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillText.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillText.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillText.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillText.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.fillText.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getImageData.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getImageData.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getImageData.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getImageData.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getImageData.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getImageData.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isContextLost.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isContextLost.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isContextLost.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isContextLost.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isContextLost.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isContextLost.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath.tutorial -->

D
DCloud_LXH 已提交
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_1.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_1.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_1.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_1.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_1.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_1.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_2.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_2.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_2.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_2.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_2.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_2.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_3.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_3.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_3.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_3.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_3.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInPath_3.tutorial -->

390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInStroke.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInStroke.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInStroke.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInStroke.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInStroke.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.isPointInStroke.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getLineDash.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getLineDash.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getLineDash.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getLineDash.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getLineDash.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.getLineDash.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.lineTo.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.lineTo.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.lineTo.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.lineTo.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.lineTo.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.lineTo.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.measureText.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.measureText.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.measureText.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.measureText.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.measureText.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.measureText.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.moveTo.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.moveTo.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.moveTo.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.moveTo.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.moveTo.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.moveTo.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData.tutorial -->

D
DCloud_LXH 已提交
462 463 464 465 466 467 468 469 470 471 472 473
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData_1.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData_1.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData_1.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData_1.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData_1.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.putImageData_1.tutorial -->

474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.quadraticCurveTo.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.quadraticCurveTo.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.quadraticCurveTo.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.quadraticCurveTo.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.quadraticCurveTo.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.quadraticCurveTo.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rect.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rect.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rect.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rect.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rect.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rect.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.resetTransform.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.resetTransform.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.resetTransform.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.resetTransform.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.resetTransform.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.resetTransform.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.restore.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.restore.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.restore.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.restore.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.restore.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.restore.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rotate.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rotate.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rotate.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rotate.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rotate.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.rotate.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.roundRect.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.roundRect.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.roundRect.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.roundRect.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.roundRect.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.roundRect.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.save.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.save.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.save.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.save.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.save.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.save.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.scale.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.scale.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.scale.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.scale.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.scale.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.scale.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setLineDash.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setLineDash.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setLineDash.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setLineDash.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setLineDash.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setLineDash.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setTransform.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setTransform.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setTransform.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setTransform.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setTransform.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.setTransform.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke.tutorial -->

D
DCloud_LXH 已提交
606 607 608 609 610 611 612 613 614 615 616 617
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke_1.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke_1.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke_1.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke_1.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke_1.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.stroke_1.tutorial -->

618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664
<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeRect.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeRect.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeRect.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeRect.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeRect.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeRect.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeText.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeText.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeText.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeText.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeText.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.strokeText.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.transform.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.transform.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.transform.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.transform.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.transform.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.transform.tutorial -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.translate.name -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.translate.description -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.translate.compatibility -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.translate.param -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.translate.returnValue -->

<!-- CUSTOMTYPEJSON.CanvasRenderingContext2D.methods.translate.tutorial -->
DCloud-yyl's avatar
DCloud-yyl 已提交
665 666 667 668 669 670 671 672

### 使用自定义字体@custonfont
在 canvas 中调用 [CanvasRenderingContext2D.filltext](#filltext)[CanvasRenderingContext2D.stroketext](#stroketext) 绘制文字时,可通过 `font` 属性指定绘制文字所使用的字体样式,其中字体名称(fontfamily)可设置自定义字体。

当使用自定义字体时,需先通过 [uni.loadFontFace](load-font-face.md) 加载字体,字体加载成功之后在设置 `font` 属性指定字体名称。

完整示例代码参考[hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/component/canvas/canvas-context.uvue)