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

Recommended Answers

All 3 Replies

Here's some tutorials i found through a quick Google search, or if you're feeling more extreme, you could try one of these

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...).

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.