fillRect পদ্ধতি
fillRect পদ্ধতিটি একটি নির্দিষ্ট বিন্দুতে
একটি ভরাট আয়তক্ষেত্র আঁকে। প্রথম দুটি প্যারামিটার
আঁকা আয়তক্ষেত্রের উপরের বাম কোণটি থাকবে
এরকম বিন্দুর স্থানাঙ্ক নির্দিষ্ট করে।
সিনট্যাক্স
context.fillRect(x, y, width, height);
উদাহরণ
চলুন fillRect ব্যবহার করে একটি ভরাট আয়তক্ষেত্র আঁকি:
<canvas id="canvas" width="200" height="200" style="background: #f4f4f4;"></canvas>
let canvas = document.querySelector('#canvas');
let ctx = canvas.getContext('2d');
ctx.fillRect(50, 50, 100, 75);
: