note 98090 deleted from function.imagesy by thiago
| From: | thiago@php.net | Date: | Tue, 25 May 2010 20:01:46 +0000 |
| Subject: | note 98090 deleted from function.imagesy by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-169595@lists.php.net to get a copy of this message | ||
Note Submitter: mauricio dot guarize at gmail dot com
Reason: non-english
----
Ho sviluppato questo esempio basato sulla documentazione
di php.net/manual riguardo alla generazione di immagini in PHP e vorrei condividere con voi.Allora
eccolo:
<?php
$file="img/image1.png";
$img =imagecreatefrompng($file);
if ($img) {
//Ottiene la larghezza reale della nostra immagine .png
$img_width = imagesx($img);
//Ottiene l'altezza reale della nostra immagine .png
$img_height = imagesy($img);
//Pulisce le risorse
ImageDestroy($img);
}
echo '<table>
<tr>
<td><img src="img/image1.png" ></td>
</tr>
<tr>
<td>La larghezza dell\'immagine e : '.$img_width.'
pixel</td></tr>
<tr>
<td>L\'altezza dell\'immagine e : '.$img_height.' pixel </td>
</tr></table>';
?>