# CanvasRenderingContext2D对象 - [fillRect\(\)](#zh-cn_topic_0000001173164707_section16678142165920) - [fillStyle](#zh-cn_topic_0000001173164707_section159395553313) - [clearRect\(\)](#zh-cn_topic_0000001173164707_section205940367194) - [strokeRect\(\)](#zh-cn_topic_0000001173164707_section18427819195711) - [fillText\(\)](#zh-cn_topic_0000001173164707_section114524106587) - [strokeText\(\)](#zh-cn_topic_0000001173164707_section4144191355810) - [measureText\(\)](#zh-cn_topic_0000001173164707_section378313153588) - [lineWidth](#zh-cn_topic_0000001173164707_section652391716583) - [strokeStyle](#zh-cn_topic_0000001173164707_section1191517562337) - [stroke\(\)](#zh-cn_topic_0000001173164707_section1071523411019) - [beginPath\(\)](#zh-cn_topic_0000001173164707_section12670134392) - [moveTo\(\)](#zh-cn_topic_0000001173164707_section16813157310) - [lineTo\(\)](#zh-cn_topic_0000001173164707_section4767915838) - [closePath\(\)](#zh-cn_topic_0000001173164707_section86825473917) - [lineCap](#zh-cn_topic_0000001173164707_section6852133718410) - [lineJoin](#zh-cn_topic_0000001173164707_section395812401442) - [miterLimit](#zh-cn_topic_0000001173164707_section429711421945) - [font](#zh-cn_topic_0000001173164707_section17597332121110) - [textAlign](#zh-cn_topic_0000001173164707_section15681153321114) - [textBaseline](#zh-cn_topic_0000001173164707_section77981136141111) - [createPattern\(\)](#zh-cn_topic_0000001173164707_section1034582183919) - [bezierCurveTo\(\)](#zh-cn_topic_0000001173164707_section450521614318) - [quadraticCurveTo\(\)](#zh-cn_topic_0000001173164707_section12938183173) - [arc\(\)](#zh-cn_topic_0000001173164707_section102329511716) - [arcTo\(\)](#zh-cn_topic_0000001173164707_section3172156571) - [ellipse\(\)6+](#zh-cn_topic_0000001173164707_section918313239192) - [rect\(\)](#zh-cn_topic_0000001173164707_section1351519304107) - [fill\(\)](#zh-cn_topic_0000001173164707_section14842031151015) - [clip\(\)](#zh-cn_topic_0000001173164707_section1355171921416) - [rotate\(\)](#zh-cn_topic_0000001173164707_section7682182091419) - [scale\(\)](#zh-cn_topic_0000001173164707_section157714218144) - [transform\(\)](#zh-cn_topic_0000001173164707_section1675964717570) - [setTransform\(\)](#zh-cn_topic_0000001173164707_section1439382216440) - [translate\(\)](#zh-cn_topic_0000001173164707_section931011253449) - [createPath2D\(\)6+](#zh-cn_topic_0000001173164707_section6654994314) - [globalAlpha](#zh-cn_topic_0000001173164707_section188252174810) - [drawImage\(\)](#zh-cn_topic_0000001173164707_section1953117410488) - [restore\(\)](#zh-cn_topic_0000001173164707_section64027684817) - [save\(\)](#zh-cn_topic_0000001173164707_section410672635214) - [createLinearGradient\(\)6+](#zh-cn_topic_0000001173164707_section1696310905) - [createRadialGradient\(\)6+](#zh-cn_topic_0000001173164707_section121861417143711) - [createImageData\(\)](#zh-cn_topic_0000001173164707_section2021142714524) - [getImageData\(\)](#zh-cn_topic_0000001173164707_section92731528205217) - [putImageData\(\)](#zh-cn_topic_0000001173164707_section15774154925515) - [setLineDash\(\)](#zh-cn_topic_0000001173164707_section1934985155516) - [getLineDash\(\)](#zh-cn_topic_0000001173164707_section522105285519) - [lineDashOffset](#zh-cn_topic_0000001173164707_section8283548889) - [globalCompositeOperation](#zh-cn_topic_0000001173164707_section123871750284) - [shadowBlur](#zh-cn_topic_0000001173164707_section6207051888) - [shadowColor](#zh-cn_topic_0000001173164707_section42724396120) - [shadowOffsetX](#zh-cn_topic_0000001173164707_section1616174021219) - [shadowOffsetY](#zh-cn_topic_0000001173164707_section272013417128) - [imageSmoothingEnabled6+](#zh-cn_topic_0000001173164707_section770341132716) - [transferFromImageBitmap\(\)7+](#zh-cn_topic_0000001173164707_section9849145418469) 使用CanvasRenderingContext2D在canvas画布组件上进行绘制,绘制对象可以是矩形、文本、图片等。 - 示例 ```
|
|
|
图源对象,具体参考Image对象。 |
||
图片资源,请参考Image对象。 |
||
合成操作的类型字段。可选值有source-over(默认值),source-atop,source-in,source-out,destination-over,destination-atop,destination-in,destination-out,lighter,copy,xor。 |