18 Temmuz 2016 Pazartesi

HTML5 CANVAS GLOBALCOMPOSİTİONOPARATİON


<!DOCTYPE html>
<html>
    <head>
        <style>
            canvas{

                border:1px solid #d3d3d3;
                /*    background-color: #000;*/
                canvas {
                    cursor:none;
                }
            }
        </style>
    <script>
        window.onload = function () {
            benimtuval=document.getElementById("mycanvas");
            ctx=benimtuval.getContext("2d");
         ctx.fillStyle="blue";
         ctx.fillRect(50,50,200,200);
         ctx.globalCompositeOperation="xor";
         ctx.beginPath();
         ctx.shadowColor="#999";
         ctx.shadowOffsetX=5;
          ctx.shadowOffsetY=5;
          ctx.shadowBlur="5";
         ctx.fillStyle="red";
         ctx.arc(145,145,75,0,2*Math.PI);
         ctx.fill();
       
       
       
 
   
    }


    </script>


</head>
<body>
<img id="resim" src="bebek.png" style="display:none"/>
<canvas id="mycanvas"  width="600" height="400" >
        Your browser does not support the HTML5 canvas tag.</canvas>



</body>
</html>

Hiç yorum yok:

Yorum Gönder