0

I want to create different size of canvas in html5, but I have some confusion in making canvas. Any ideas or resouce link you have, please share

4
Contributors
3
Replies
20
Views
4 Years
Discussion Span
Last Post by Octet
0

For the size of the canvas you can just set the height and width attributes.. for example...

<canvas id="canvas1" width="640" height="480"></canvas>

Here is a basic summary of the Canvas element: HTML5 Canvas Introduction. Once you have the basic canvas element, you can then move forward with drawing on the canvas (text, images, lines, fill, rectangles, curves, etc...).

0

Just to add to what the others have said, define the width and height on the canvas element itself as opposed to in CSS files.
When defining it in a CSS file, it behaves strangely, and can result in a blurry canvas drawing.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.