Skip to content

tgs web

April 6, 2011

<html lang=”en”>
<head>
<title>Smile</title>
<style type=”text/css”>
canvas {
border: 0px solid black;
background-color:#000000;
}
</style>
// <![CDATA[javascript” >]]>
function smily() {
var cv = document.getElementById(‘canvas’).getContext(‘2d’);
if (cv == ‘undefined’) alert(‘canvas failed’);
//lingkaran besar
cv.beginPath();
cv.arc(150,150,120,0,Math.PI*2,true);
cv.fillStyle=’red’;
cv.fill();
cv.stroke();
cv.closePath();
//lingkaran kecil
cv.beginPath();
cv.arc(100,110,10,0,Math.PI*2,true);
cv.arc(200,110,10,0,Math.PI*2,true);
cv.fillStyle=’black’;
cv.fill();
cv.closePath();
//diiiikasih muluuttt
cv.beginPath();
cv.arc(150,125,105,0.6,2.5,false);
cv.stroke();
cv.closePath();
}
</script>
</head>
<body onLoad=”smily();”>
<canvas id=”canvas” width=”300″ height=”300″></canvas>
</body>
</html>

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: