HTML | canvas scale() Method
The HTML canvas scale() Method is used to scale the current drawing into smaller or larger size. After scaling the drawing, all the feature of drawing scaled. It will have to define before the canvas.
context.scale( scalewidth, scaleheight )
- scalewidth: It scale the width of current drawing, (1=100%, 0.5=50%, 2=200%, and so on).
- scaleheight: It scale the height of current drawing, (1=100%, 0.5=50%, 2=200%, and so on)
Example 1: This example uses canvas scale() Method to increase the drawing size.
Example 2: This example uses canvas scale() Method to decrease the drawing size.
Supported Browsers: The browser supported by HTML canvas scale() Method are listed below:
- Google Chrome
- Internet Explorer 9.0 or above
Attention reader! Don’t stop learning now. Get hold of all the important Comcompetitivepetitve Programming concepts with the Web Design for Beginners | HTML course.