Function.imagecolorallocatealpha

Aus PHP-Wiki

Wechseln zu: Navigation, Suche
Wickelkommode Leonie von Pinolino und Private Krankenversicherungkfz-versicherung . Unfallversicherung

imagecolorallocatealpha — Allocate a color for an image

Inhaltsverzeichnis

Beschreibung

int imagecolorallocatealpha ( resource $image , int $red , int $green , int $blue , int $alpha )


imagecolorallocatealpha() behaves identically to imagecolorallocate() with the addition of the transparency parameter alpha .

Parameter-Liste

image
red
  • Value of red component.
green
  • Value of green component.
blue
  • Value of blue component.
alpha
  • A value between 0 and 127. 0 indicates completely opaque while 127 indicates completely transparent.

The colors parameters are integers between 0 and 255 or hexadecimals between 0x00 and 0xFF.

Rückgabewerte

A color identifier or FALSE if the allocation failed.

ChangeLog

Version Beschreibung Prior to 5.1.3 Returns -1 if the allocation failed.

Beispiele

=== #1 Example of using imagecolorallocatealpha()

<?php
$size = 300;
$image=imagecreatetruecolor($size, $size);
 
// something to get a white background with black border
$back = imagecolorallocate($image, 255, 255, 255);
$border = imagecolorallocate($image, 0, 0, 0);
imagefilledrectangle($image, 0, 0, $size===
 
 
 
 
 
 
 
 
 
==Anmerkungen==
 
 
  Hinweis: Diese Funktion setzt die GD Bibliothek in
der Version 2.0.1 oder höher (empfohlen wird mindestens 2.0.28) voraus.
 
 
 
 
==Siehe auch==
* [[function.imagecolorallocate|imagecolorallocate()]]
* [[function.imagecolordeallocate|imagecolordeallocate()]]
 
[[Kategorie:PHP 4|I]]
[[Kategorie:PHP 5|I]]
[[Kategorie:Image Funktionen|I]]
Persönliche Werkzeuge