Autor | Zpráva | ||
---|---|---|---|
Venca Černík Profil |
#1 · Zasláno: 17. 10. 2007, 13:57:28
Zdravím, pomocí tohoto kódu
$obrazek = imagecreatefromjpeg("obrazek.jpg"); header("Content-Type: image/png"); imagepng($obrazek); načtu obrázek a zobrazím jej. Potřeboval bych u něj ale změnit rozměry (třeba na 50x50px) a zobrazit zmenšený obrázek. Nejlépe bez žádného "mezisouboru". jak to udělat? díky |
||
lam1t0 Profil * |
#2 · Zasláno: 17. 10. 2007, 14:04:16
<?php
$filename = "obrazek.jpg"; header("Content-Type: image/png"); list($width, $height) = getimagesize($filename); $new_width = 50; $new_height = 50; // Resample $obrazek_vystup = imagecreatetruecolor($new_width, $new_height); $obrazek = imagecreatefromjpeg($filename); imagecopyresampled($obrazek_vystup, $obrazek, 0, 0, 0, 0, $new_width, $new_height, $width, $height); // Output imagepng($obrazek_vystup); ?> |
||
Časová prodleva: 17 let
|
0