Monday, April 13, 2020

HOW TO DRAW CIRCLE ON A WEBPAGE ?

<!DOCTYPE html>

<html>
    <head>
        <meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8">
        <title>Hello, World!</title>
    </head>
   
   
    <body>
        <h1>
            Hello, World!
        </h1>
       
     
       
  
       
        Here we will study about the canvas tag. It is used for drawing lines, circles, gradients etc on a webpage.
        <br>
       
         <br>
       
         <br>
        <br>
       
       <canvas id="Circle" style="border:solid 2px" height="200" width="200">
           My browser
        </canvas>
        <br>
       
           <script type="text/javascript">
           
            alert("Welcome to my page.");
            document.write("Hello");
            var c = document.getElementById("Circle");
            var cont1 = c.getContext("2d");
          
            cont1.beginPath();
               cont1.arc(95,50,40,0,2*Math.PI);
           
              
               cont1.stroke();
           
           
           
         
           
           
        </script>
        
       
     </body>
   
   
</html>


OUTPUT : 


No comments:

Post a Comment