কম্পিউটার টিউটোরিয়াল

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

imagecharup() ফাংশন একটি ক্যারেক্টার ভার্টিক্যালি ড্র করার জন্য ব্যবহৃত হয়।

সিনট্যাক্স

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

প্যারামিটার

  • img: imagecreatetruecolor() দিয়ে ইমেজ তৈরি করুন

  • font: ফন্ট সাইজ সেট করুন। ল্যাটিন২ এনকোডিং-এ বিল্ট-ইন ফন্টের জন্য ১, ২, ৩, ৪, ৫ হতে পারে

  • x: x-কোঅর্ডিনেট

  • y: y-কোঅর্ডিনেট

  • c: ড্র করা ক্যারেক্টার

  • color: কালার আইডেন্টিফায়ার

রিটার্ন

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() ফাংশন