Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Miniatura obrazka, a potem wyswietlenie jego
NetJaro
post
Post #1





Grupa: Zarejestrowani
Postów: 475
Pomógł: 0
Dołączył: 1.04.2005
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


Jak zrobić miniaturę obrazka a potem po kliknięciu na tą miniature pojawił się oryginalny rozmiar obrazka w popupie?

Pozdro :-)

P.S

Mam kod co tworzy miniaturę obrazka:

  1. <?php
  2. header('Content-type: image/jpeg');
  3.  
  4. $myimage = resizeImage(&#092;"./img/$id.jpg\", \"200\", \"200\");
  5. function resizeImage($filename, $newwidth, $newheight){
  6. list($width, $height) = getimagesize($filename);
  7. if($width > $height && $newheight < $height){
  8. $newheight = $height / ($width / $newwidth);
  9. } else if ($width < $height && $newwidth < $width) {
  10. $newwidth = $width / ($height / $newheight);
  11. } else {
  12. $newwidth = $width;
  13. $newheight = $height;
  14. }
  15. $thumb = imagecreatetruecolor($newwidth, $newheight);
  16. $source = imagecreatefromjpeg($filename);
  17. imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
  18. return imagejpeg($thumb);
  19. }
  20. ?>


Lecz on wyświetla obrazek sam (tak jak działa <img>).

Ten post edytował NetJaro 7.05.2005, 20:42:39
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 11:45