PHP 8.4.6 Released!

Imagick::setBackgroundColor

(PECL imagick 2, PECL imagick 3)

Imagick::setBackgroundColorDefine a cor de fundo padrão do objeto

Descrição

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

Define a cor de fundo padrão do objeto.

Parâmetros

background

Valor Retornado

Retorna true em caso de sucesso.

Registro de Alterações

Versão Descrição
PECL imagick 2.1.0 Agora permite uma string representando a cor como parâmetro. As versões anteriores permitiam apenas um objeto ImagickPixel.

adicione uma nota

Notas Enviadas por Usuários (em inglês) 1 note

up
0
eleg
13 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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant