PHP 8.3.4 Released!

Imagick::setBackgroundColor

(PECL imagick 2, PECL imagick 3)

Imagick::setBackgroundColorConfigure la couleur de fond par défaut

Description

public Imagick::setBackgroundColor(mixed $background): bool

Configure la couleur de fond par défaut.

Liste de paramètres

background

Valeurs de retour

Retourne true en cas de succès.

Historique

Version Description
PECL imagick 2.1.0 Permet désormais l'utilisation d'une chaîne pour représenter la couleur. Les versions précédentes ne permettaient que les objets ImagickPixel.

add a note

User Contributed Notes 1 note

up
0
eleg
12 years ago
Be cautious and set bgcolor BEFORE importing a SVG with transparency! :-/

<?php

$im
= new Imagick();
$im->setBackgroundColor(new ImagickPixel('transparent'));

$im->readImage('carte_Alain2.svg');

$im->setImageFormat("png32");

header('Content-type: image/png');
echo
$im;
?>
To Top