olampiad
دوشنبه 13 مرداد 1393, 10:24 صبح
سلام و خسته نباشید ب اساتید
به این کد من ی نگا بندازید.
میشه یک بار ابن رو روی سیستم خودتون اجرا کنید.
میبینید من میخوام با استفاده از canvas یک تابلو ایست طراحی کنم.
حالا من میخوام ب دایره ای که درست کردم پس زمینه بدم.
هرکاری کردم نشد.
میشه در این مورد یکم راهنمایی کنید
در canvas چطور میتونم ب دایره پس زمینه بدم.
ممنون میشم.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<canvas id="myCanvas" width="200" height="200" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.arc(95,80,60,0,2*Math.PI);
ctx.stroke();
ctx.fillStyle='blue';
ctx.font="20px Arial";
ctx.fillText('ایست',70,90);
ctx.fillRect(55,70,80,20);
</script>
</body>
</html>
به این کد من ی نگا بندازید.
میشه یک بار ابن رو روی سیستم خودتون اجرا کنید.
میبینید من میخوام با استفاده از canvas یک تابلو ایست طراحی کنم.
حالا من میخوام ب دایره ای که درست کردم پس زمینه بدم.
هرکاری کردم نشد.
میشه در این مورد یکم راهنمایی کنید
در canvas چطور میتونم ب دایره پس زمینه بدم.
ممنون میشم.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<canvas id="myCanvas" width="200" height="200" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.arc(95,80,60,0,2*Math.PI);
ctx.stroke();
ctx.fillStyle='blue';
ctx.font="20px Arial";
ctx.fillText('ایست',70,90);
ctx.fillRect(55,70,80,20);
</script>
</body>
</html>