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

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

imagecolortransparent() फंक्शन का उपयोग ट्रांसपेरेंट इमेज का रंग सेट करने के लिए किया जाता है।

सिंटैक्स

imagecolortransparent ( img, color )

पैरामीटर्स

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

  • color: imagecolorallocate() के साथ बनाया गया कलर आइडेंटिफायर।

रिटर्न

imagecolortransparent() फंक्शन नए ट्रांसपेरेंट कलर का आइडेंटिफायर लौटाता है। यदि कलर निर्दिष्ट नहीं है और इमेज में कोई ट्रांसपेरेंट कलर नहीं है तो रिटर्न मान -1 है।

उदाहरण

निम्नलिखित एक उदाहरण है

<?php 
    $img = imagecreatetruecolor(500, 400); 
    $blue = imagecolorallocate($img, 0, 0, 255); 
    $transparent = imagecolorallocate($img, 0, 0, 0); 
    imagecolortransparent($img, $transparent); 
    imagefilledrectangle($img, 80, 90, 400, 220, $blue); 
    header('Content-Type: image/png'); 
    imagepng($img); 
    imagedestroy($img); 
?>

आउटपुट

निम्नलिखित आउटपुट है:

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

  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