



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Enrollment No : 200420107076 Name : Raj Dudhat
Draw Line, Rectangle, Circle, Arc, House. Apply different styles.
Canvas Drawing
Enrollment No : 200420107076 Name : Raj Dudhat ctx.strokeStyle = "red"; ctx.stroke(); // Draw a circle ctx.beginPath(); ctx.arc(200, 250, 50, 0, 2 * Math.PI); ctx.fillStyle = "lightgreen"; ctx.fill(); ctx.lineWidth = 5; ctx.strokeStyle = "green"; ctx.stroke(); // Draw an arc ctx.beginPath(); ctx.arc(100, 250, 50, Math.PI / 4, (3 * Math.PI) / 4); ctx.lineWidth = 2; ctx.strokeStyle = "purple"; ctx.stroke();
HOUSE:
Document
canvas
Enrollment No : 200420107076 Name : Raj Dudhat context.beginPath(); context.rect(150, 300, 200, 200); context.lineWidth = 5; context.strokeStyle = "red"; context.fillStyle = "brown"; context.fill(); context.stroke(); context.beginPath(); context.rect(225, 400, 50, 100); context.lineWidth = 5; context.strokeStyle = "black"; context.fillStyle = "green"; context.fill(); context.stroke(); context.beginPath(); context.moveTo(100, 300); context.lineTo(400, 300); context.lineWidth = 5; context.strokeStyle = "purple"; context.lineTo(250, 200); context.closePath(); context.fillStyle = "blue"; context.fill(); context.stroke();
Enrollment No : 200420107076 Name : Raj Dudhat