imagepng

(PHP 3 >= 3.0.13, PHP 4, PHP 5)

imagepng -- Output a PNG image to either the browser or a file

Descrizione

bool imagepng ( resource image [, string filename [, int quality]] )

Outputs or saves a PNG image from the given image.

Elenco dei parametri

image

An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().

filename

The path to the saved file. If not set or NULL, the raw image stream will be outputed directly.

quality

Compression level: from 0 (no compression) to 9.

Valori restituiti

Restituisce TRUE in caso di successo, FALSE in caso di fallimento.

Log delle modifiche

VersioneDescrizione
5.1.2 Added the quality parameter.

Esempi

<?php
$im 
imagecreatefrompng("test.png");
imagepng($im);
?>