কম্পিউটার

PHP-তে imagecolorat() ফাংশন


imagecolorat() ফাংশন পিক্সেলের রঙের সূচক পায়।

সিনট্যাক্স

imagecolorat( $img, $x, $y )

প্যারামিটার

  • img :imagecreatetruecolor() ফাংশন দিয়ে একটি ছবি তৈরি করুন।

  • x :বিন্দুর এক্স-অর্ডিনেট।

  • y: বিন্দুর y-অর্ডিনেট।

ফেরত

imagecolorat() ফাংশন ব্যর্থ হলে রঙ সূচক বা FALSE ফেরত দেয়।

উদাহরণ

নিম্নলিখিত একটি উদাহরণ:

<?php
   $img = imagecreatefrompng("https://www.tutorialspoint.com/images/tp-logo-diamond.png");
   $rgb = imagecolorat($img, 15, 25);
   $colors = imagecolorsforindex($img, $rgb);
   var_dump($colors);
?>

আউটপুট

নিম্নলিখিত আউটপুট:

array(4) { ["red"]=> int(255) ["green"]=> int(255) ["blue"]=> int(255) ["alpha"]=> int(127) }

  1. PHP-তে imagecreate() ফাংশন

  2. PHP-তে imagefill() ফাংশন

  3. PHP-তে imagefilledrectangle() ফাংশন

  4. PHP-তে imagefilledellipse() ফাংশন