imagefilltoborder() পিএইচপি-তে একটি অন্তর্নির্মিত ফাংশন যা একটি নির্দিষ্ট রঙের সাথে ফ্লাড ফিল করতে ব্যবহৃত হয়, যার বর্ডার রঙ বর্ডার দ্বারা সংজ্ঞায়িত করা হয়। পূরণের জন্য শুরুর বিন্দু হল (x,y) বা উপরের বাম হল (0, 0) এবং অঞ্চলটি রঙ দিয়ে পূর্ণ।
সিনট্যাক্স
bool imagefilltoborder(resource $image, int $x, int $y, int $border, int $color)
পরামিতি
imagefilltoborder() পাঁচটি ভিন্ন প্যারামিটার লাগে:$image, $x, $y, $border এবং $color।
-
$ছবি - এটি ইমেজ রিসোর্স।
-
$x − শুরুর x-অর্ডিনেট নির্দিষ্ট করে।
-
$y - শুরুর y- স্থানাঙ্ক নির্দিষ্ট করে।
-
$বর্ডার − সীমানা রঙ নির্দিষ্ট করে।
-
$color − রঙ নির্দিষ্ট করে।
রিটার্ন মান
এটি সাফল্যের উপর সত্য এবং ব্যর্থতার উপর মিথ্যা ফেরত দেয়।
উদাহরণ 1
<?php
// Load the GIF image from local drive folder.
$img = imagecreatefromgif('C:\xampp\htdocs\Images\img39.gif');
// Create the image colors
$borderColor = imagecolorallocate($img, 0, 200, 0);
$fillColor = imagecolorallocate($img, 122, 122, 122);
// Add fill to border
imagefilltoborder($img, 0, 0, $borderColor, $fillColor);
// Show the output image
header('Content-type: image/gif');
imagepng($img);
?> আউটপুট
PHP-এ imagefilltoborder() ফাংশন ব্যবহার করার আগে GIF ছবি।

PHP-এ imagefilltoborder() ফাংশন ব্যবহার করার পর GIF ছবি।

উদাহরণ 2:একটি রঙ দিয়ে একটি উপবৃত্ত পূর্ণ করুন
<?php
// Created the image, set the background to gray color
$img = imagecreatetruecolor(700, 500);
imagefilledrectangle($img, 0, 0, 500, 500,imagecolorallocate($img, 122, 122, 122));
// Draw an ellipse to fill with a black border.
imageellipse($img, 300, 300, 300, 300, imagecolorallocate($img, 0, 0, 0));
// Set the border and fill using the blue colors
$border = imagecolorallocate($img, 0, 0, 0);
$fill = imagecolorallocate($img, 0, 0, 255);
// Fill the selection
imagefilltoborder($img, 300, 300, $border, $fill);
// show the output image and free memory
header('Content-type: image/gif');
imagepng($img);
imagedestroy($img);
?> আউটপুট
