কম্পিউটার

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


imagecharup() ফাংশনটি একটি অক্ষরকে উল্লম্বভাবে আঁকতে ব্যবহৃত হয়।

সিনট্যাক্স

imagecharup( img, font, x, y, c, color )

প্যারামিটার

  • img : imagecreatetruecolor()

    দিয়ে একটি ছবি তৈরি করুন
  • ফন্ট: ফন্ট সাইজ সেট করে। ল্যাটিন2 এনকোডিং-এ বিল্ট-ইন ফন্টের জন্য এটি 1, 2, 3, 4, 5 হতে পারে

  • x: এক্স-সমন্বয়

  • y :y-সমন্বয়

  • c: অক্ষর আঁকা হবে

  • রঙ: রঙ শনাক্তকারী

ফেরত

imagecharup() ফাংশন সফল হলে TRUE বা ব্যর্থ হলে FALSE প্রদান করে।

উদাহরণ

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

<?php
   $img = imagecreate(300, 300);
   $str = 'Demo';
   $bg = imagecolorallocate($img, 190, 255, 255);
   $color = imagecolorallocate($img, 120, 60, 100);
   imagecharup($img, 5, 30, 50, $str, $color);
   header('Content-type: image/png');
   imagepng($img);
?>

আউটপুট

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

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

উদাহরণ

আসুন আরেকটি উদাহরণ দেখি:

<?php
   $img = imagecreate(270, 270);
   $str = 'Example';
   $bg = imagecolorallocate($img, 160, 185, 175);
   $color = imagecolorallocate($img, 100, 120, 100);
   imagecharup($img, 10, 80, 100, $str, $color);
   header('Content-type: image/png');
   imagepng($img);
?>

আউটপুট

নিম্নলিখিত আউটপুট যা বিভিন্ন মাত্রা সহ অক্ষর E অঙ্কন করে:

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


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

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

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

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