Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP] Problem z orientacją tabeli w gd
Forum PHP.pl > Forum > Przedszkole
Szwejk
Witam, mój problem dotyczy dynamicznie generowanych obrazów. Udało sie poprzerabiać poniższy skrypt ale chciałbym jeszcze zmienić jego orientacje z poziomej na pionową.

  1. <?php
  2. header ("Content-type: forum/image/png");
  3. $percent = 0;
  4. if (isset($_GET['p']))
  5. {
  6. $percent = $_GET['p'];
  7. $perx = $percent + 1;
  8. }
  9. else
  10. {
  11. $percent = 0;
  12. }
  13. $percent = str_replace(' ', '', $percent);
  14. $percent = round($percent);
  15. if ($percent >= 100)
  16. {
  17. $percent = 100;
  18. $perx = 80;
  19. }
  20. elseif ($percent < 1)
  21. {
  22. $percent = 0;
  23. $perx = 85;
  24. }
  25. elseif ($percent < 10)
  26. {
  27. $perx = 85;
  28. }
  29. else
  30. {
  31. $perx = 83;
  32. }
  33. $text = '';
  34. if (isset($_GET['t']))
  35. {
  36. $text = $_GET['t'];
  37. }
  38. if (strlen($text) > 34)
  39. {
  40. $text = substr($text, 0, 34);
  41. }
  42. $r = 255-(.83*$percent);
  43. $g = 63+(1.92*$percent);
  44. $b = 66-(.03*$percent);
  45. $img = imagecreatetruecolor(50, 10);
  46. $bg = imagecolorallocate($img, 98, 99, 99);
  47. $fg = imagecolorallocate($img, 255, 255, 255);
  48. $pg = imagecolorallocate($img, $r, $g, $b);
  49. imagefilledrectangle($img, 0, 0, 98, 10, $bg);
  50. imagefilledrectangle($img, 1, 1, 98, 8, $fg);
  51. if ($percent != 0)
  52. {
  53. imagefilledrectangle($img, 1, 1, $percent*0.5, 8, $pg);
  54. }
  55. imagestring($img, 1, 2, 1, $text, $bg);
  56. imagepng($img);
  57. imagedestroy($img);
  58. ?>


Za wszelką pomoc będę wdzięczny : )
sada
  1. imagerotate
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.