HTML with SVG concept
Scalable Vector Graphics (SVG) is a 2D vector image format based on an XML syntax.
The W3C began work on SVG in the late 1990s, but SVG only became popular when Internet Explorer 9 came out with SVG support. All major browsers now support SVG.
Based on an XML syntax, SVG can be styled with CSS and made interactive using JavaScript. HTML5 now allows direct embedding of SVG tags in an HTML document.
As a vector image format, SVG graphics can scale infinitely, making them invaluable in responsive design, since you can create interface elements and graphics that scale to any screen size. SVG also provides a useful set of tools, such as clipping, masking, filters, and animations.(Source:https://developer.mozilla.org/en-US/docs/Glossary/SVG)
----------------------------------------------------------------------------------------------------------------
Let's understand SVG with the help of following examples.
-------------------------------------------------------------------------------------------
1)HTML with SVG to draw circle.
2)HTML with SVG to draw rectangle
3)HTML with SVG to draw rectangle
4)HTML with SVG to draw ellipse.
5)HTML with SVG to draw line
6)HTML with SVG to draw polygon.
7)HTML with SVG to draw polyline
8)HTML with SVG to draw path
9)HTML with SVG to draw text
10)HTML with SVG to draw text.
11)HTML with SVG to animate object.
12)HTML with SVG to animate the circle.
HTML graphics with CANVAS tag
The Canvas API provides a means for drawing graphics via JavaScript and the HTML <canvas>
element. Among other things, it can be used for animation, game graphics, data visualization, photo manipulation, and real-time video processing.
The Canvas API largely focuses on 2D graphics. The WebGL API, which also uses the <canvas>
element, draws hardware-accelerated 2D and 3D graphics.
source:https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API
-----------------------------------------------------------------------------------------------------------------
LEt's understand about canvas in detail using following example.
--------------------------------------------------------------------------------------------------------
1)HTML with CANVAS to draw rectangle.
2)HTML with CANVAS to draw square.
3)HTML with canvas to draw straight line.
4)HTML with canvas to draw circle.
5)HTML with canvas to draw arc.
6)HTML with canvas to write text on canvas.
7) HTML with canvas to write text on canvas. with background color
8)HTML with canvas to fill entire canvas with color