Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> PHP

PHP में imagecharup() फंक्शन

imagecharup() फंक्शन का उपयोग कैरेक्टर को वर्टिकली ड्रॉ करने के लिए किया जाता है।

सिंटैक्स

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

पैरामीटर्स

  • img: imagecreatetruecolor() के साथ इमेज बनाएं

  • font: फॉन्ट साइज़ सेट करता है। यह लैटिन2 एन्कोडिंग में बिल्ट-इन फॉन्ट्स के लिए 1, 2, 3, 4, 5 हो सकता है

  • 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 में imagefill() फंक्शन PHP में imagefill() फंक्शन

    PHP में imagefill() फंक्शन छवि में निर्दिष्ट प्रारंभिक बिंदु से फ्लड फिल (flood fill) ऑपरेशन करता है - अर्थात्, यह मिलते-जुलते रंग वाले सभी जुड़े हुए क्षेत्र को निर्दिष्ट रंग से भर देता है। सिंटैक्स (Syntax) imagefill(GdImage $image, int $x, int $y, int $color): bool पैरामीटर्स (Parameters) $ima

  1. PHP में imagefilledrectangle() फंक्शन PHP में imagefilledrectangle() फंक्शन

    PHP में imagefilledrectangle() फंक्शन छवि पर एक भरा हुआ आयत (filled rectangle) खींचता है। यह निर्दिष्ट दो कोनों के बीच के पूरे आयताकार क्षेत्र को रंग से भर देता है। सिंटैक्स (Syntax) imagefilledrectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool पैरामीटर्स (Parameters)

  1. PHP में imagefilledellipse() फंक्शन PHP में imagefilledellipse() फंक्शन

    PHP में imagefilledellipse() फंक्शन छवि पर एक भरा हुआ अंडाकार (filled ellipse) खींचता है। केंद्र निर्देशांक, चौड़ाई और ऊंचाई निर्दिष्ट करके अंडाकार बनाया जाता है। सिंटैक्स (Syntax) imagefilledellipse(GdImage $image, int $cx, int $cy, int $width, int $height, int $color): bool पैरामीटर्स (Paramete