par
Erazer » 11 avr. 2006, 21:00
si tu fais une image tu peux faire par exemple
image.php
<?php
header('Content-type: image/jpeg');
// Le fichier
$filename = 'test.jpg';
//$percent = 0.5;
// Calcul des nouvelles dimensions
list($width, $height) = getimagesize($filename);
$new_width = 186;
$new_height = 207;
// Redimensionnement
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Affichage
imagejpeg($image_p, null, 100);
?>
et ensuite une page
index.html
avec ton code html et tout
pour afficher ton image tu fais
<img src="image.php" alt="mon image />
si tu fais une image tu peux faire par exemple
image.php
[php]<?php
header('Content-type: image/jpeg');
// Le fichier
$filename = 'test.jpg';
//$percent = 0.5;
// Calcul des nouvelles dimensions
list($width, $height) = getimagesize($filename);
$new_width = 186;
$new_height = 207;
// Redimensionnement
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Affichage
imagejpeg($image_p, null, 100);
?>
[/php]
et ensuite une page
index.html
avec ton code html et tout
pour afficher ton image tu fais
<img src="image.php" alt="mon image />