Canvas (ehh)
Creating a Canvas
You can create a canvas in Ehhlang using the ehh
keyword. The ehh
keyword is followed by the width and height of the canvas. For example, to create a canvas of width 800 and height 600 with the black color, you can use the following code:
Output:
In the above example, we have created a canvas of width 800 and height 600 with the black color. We have also specified the output file name as canvas.png
. The output
property is optional. If you don't specify the output file name, the default file name will be ehhmage.png
.
Properties
The canvas has the following properties:
width
: The width of the canvas.height
: The height of the canvas.background
: The background color of the canvas. The color is specified in RGB formatR, G, B
.output
: The output file name. The default file name isoutput.png
.
Conclusion
Canvas is the area where you can draw images. You can create a canvas in Ehhlang using the ehh
keyword and draw different objects on it. You can also specify the width, height, background color, and output file name of the canvas. This helps you to create images with different dimensions and colors.