# CanvasRenderingContext2D >![](../../public_sys-resources/icon-note.gif) **NOTE:** >This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. Use **RenderingContext** to draw rectangles, text, images, and other objects on a canvas. ## APIs CanvasRenderingContext2D\(setting: RenderingContextSettings\) - Parameters
<color> | CanvasGradient | CanvasPattern |
|
||
<color> | CanvasGradient | CanvasPattern |
|
||
Style of the specified line endpoint. The options are as follows: |
|||
Style of the intersection point between line segments. The options are as follows:
|
|||
Maximum miter length. The miter length is the distance between the inner corner and the outer corner where two lines meet. |
|||
Syntax: ctx.font="font-size font-family"
Syntax: ctx.font="font-style font-weight font-size font-family"
|
|||
Text alignment mode. Available values are as follows: |
|||
Horizontal alignment mode of text. Available values are as follows:
|
|||
Opacity. 0.0: completely transparent; 1.0: completely opaque. |
|||
Composition operation type. Available values are as follows: 'source-over', 'source-atop', 'source-in', 'source-out', 'destination-over', 'destination-atop', 'destination-in', 'destination-out', 'lighter', 'copy', and 'xor'. |
|||
Blur level during shadow drawing. A larger value indicates a more blurred effect. The precision is float. |
|||
Whether to adjust the image smoothness during image drawing. The value true means to enable this feature, and false means the opposite. |
|||
Image smoothness. The value can be 'low', 'medium', or 'high'. |
X-coordinate of the upper left corner of the rectangle stroke. |
||||
Y-coordinate of the upper left corner of the rectangle stroke. |
||||
Source image. For details, see ImageBitmap. |
||||
Repetition mode. The value can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. |
Clockwise rotation angle. You can use Math.PI / 180 to convert the angle to a radian. |
Image resource. For details, see ImageBitmap. |
||||
X-coordinate of the upper left corner of the rectangle used to crop the source image. |
||||
Y-coordinate of the upper left corner of the rectangle used to crop the source image. |
||||
X-coordinate of the upper left corner of the drawing area on the canvas. |
||||
Y-coordinate of the upper left corner of the drawing area on the canvas. |
||||
ImageData object with the same width and height copied from the original ImageData object. |
Radius of the start circle, which must be a non-negative finite number. |
||||
Radius of the end circle, which must be a non-negative finite number. |