কম্পিউটার

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


imagecolorset() ফাংশন নির্দিষ্ট প্যালেট সূচকের জন্য রঙ সেট করে। এটি ব্যবহার করে প্যালেটেড ছবিতে বন্যা-ভরাটের মতো প্রভাব তৈরি করুন৷

সিনট্যাক্স

imagecolorset ( img, index, red, green, blue, alpha )

প্যারামিটার

  • img :imagecreatettruecolor() ফাংশন

    দিয়ে তৈরি করা ছবি
  • সূচী :প্যালেট চিত্রের সূচী

  • লাল :লাল উপাদানের মান

  • সবুজ :সবুজ উপাদানের মান

  • নীল :নীল উপাদানের মান

  • আলফা :ছবি থাকলে স্বচ্ছতা।

ফেরত

imagecolorset() ফাংশন কিছুই প্রদান করে না।

উদাহরণ

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

<?php
   $img = imagecreate(550, 400);
   imagecolorallocate($img, 0, 0, 0);
   $bgcolor = imagecolorat($img, 70, 85);
   imagecolorset($img, $bgcolor, 30, 110, 150);
   header('Content-Type: image/png');
   imagepng($img);
   imagedestroy($img);
?>

আউটপুট

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

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


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

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

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

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