// DANE DO RYSOWANIA $obrazek = $folder.$p_nazwa_zm; $demot = imagecreatefromjpeg($obrazek); $obrazek_szerokosc = "640"; $obrazek_wysokosc = imagesy($demot); $szerokosc = 740; $wysokosc = $obrazek_wysokosc + 40 + 120; $image2 = imagecreatetruecolor($szerokosc, $wysokosc); $tlo = imagecolorallocate($image2, 26, 26, 26); $szary = imagecolorallocate($image2, 170, 170, 170); $bialy = imagecolorallocate($image2, 220, 220, 220); $font1 = 'verdana.ttf'; $rozmiar1 = "10"; $font2 = 'times.ttf'; $rozmiar2 = "24"; $font3 = 'tahoma.ttf'; $rozmiar3 = "12"; $stopka = $ustawienia['adres']; $wymiary1 = imagettfbbox($rozmiar1, 0, $font1, $stopka); $x1_1 = $wymiary1[0]; $x1_2 = $wymiary1[2]; $x1 = $x1_2 - $x1_1; $x1_srodek = ($szerokosc - $x1)/2; $wymiary2 = imagettfbbox($rozmiar2, 0, $font2, $tytul); $x2_1 = $wymiary2[0]; $x2_2 = $wymiary2[2]; $x2 = $x2_2 - $x2_1; $x2_srodek = ($szerokosc - $x2)/2; $wymiary3 = imagettfbbox($rozmiar3, 0, $font3, $opis); $x3_1 = $wymiary3[0]; $x3_2 = $wymiary3[2]; $x3 = $x3_2 - $x3_1; $x3_srodek = ($szerokosc - $x3)/2; if($x3 > ($szerokosc - 40)) //do poprawy { imagettftext($image2, $rozmiar3, 0, $x3_srodek, $wysokosc-55, $bialy, $font3, $opis); } else { imagettftext($image2, $rozmiar3, 0, $x3_srodek, $wysokosc-55, $bialy, $font3, $opis); } // RYSOWANIE OBRAZKA imagefill($image2, 0, 0, $tlo); imagefilledrectangle($image2, 48, 38, 692, $obrazek_wysokosc + 42, $bialy); imagettftext($image2, $rozmiar2, 0, $x2_srodek, $wysokosc-85, $bialy, $font2, $tytul); //imagettftext($image2, $rozmiar3, 0, $x3_srodek, $wysokosc-55, $bialy, $font3, $opis); imagettftext($image2, $rozmiar1, 0, $x1_srodek, $wysokosc-10, $szary, $font1, $stopka); imagecopy($image2, $demot, 50, 40, 0, 0, $obrazek_szerokosc, $obrazek_wysokosc); // WYŚWIETLANIE OBRAZKA imagejpeg($image2, $folder.$p_nazwa_zm); // PORZĄDKI imagedestroy($image2);
ref