PHP sayfa içinde metni resme çevirme
6
●327
- 19-06-2020, 20:46:26PDO sayfamda metni resme çevirmek istiyorum. Piyasadaki kodları kullandığımda benim detay sayfamda komple siyah bir ekran oluyor ve div içinde resim yapmak istediğim metni kullanamıyorum. Lütfen buton, resim ve metni resme çevirme örneğini bir php içinde kullanabilirmisiniz. teşekkürler
- 19-06-2020, 20:51:21
- 19-06-2020, 20:53:46Bunu kullandım ama php sayfada kullandığımda patlıyor.. resim atayım hemencarasar adlı üyeden alıntı: mesajı görüntüle
- 19-06-2020, 21:01:08Kimlik doğrulama veya yönetimden onay bekliyor.
<?php $yazi = "BURAYA YAZI GELECEK"; $resim = imagecreate( 800, 600 ); // RESİM BOYUTU $arkaplan = imagecolorallocate( $resim, 0, 0, 255 ); $yazirengi = imagecolorallocate( $resim, 255, 255, 0 ); imagestring( $resim, 4, 30, 25, $yazi, $yazirengi ); imagesetthickness ( $resim, 5 ); header( "Content-type: image/png" ); imagepng( $resim ); imagecolordeallocate( $yazirengi ); imagecolordeallocate( $arkaplan ); imagedestroy( $resim ); ?>
ÖRNEK KODLAR
https://www.legendblogs.com/blog/convert-text-to-image-in-php/121766
https://www.codexworld.com/convert-text-to-image-php/ - 19-06-2020, 22:33:42carasar adlı üyeden alıntı: mesajı görüntüle

<?php $input_text = $marketcek['market_adres']; $width = (strlen($input_text)*9)+20; $height = 30; $textImage = imagecreate($width, $height); $color = imagecolorallocate($textImage, 0, 0, 0); imagecolortransparent($textImage, $color); imagestring($textImage, 5, 10, 5, $input_text, 0xFFFFFF); // create background image layer $background = imagecreatefromjpeg('bg.jpeg'); // Merge background image and text image layers imagecopymerge($background, $textImage, 15, 15, 0, 0, $width, $height, 100); $output = imagecreatetruecolor($width, $height); imagecopy($output, $background, 0, 0, 20, 13, $width, $height); ob_start(); imagepng($output); printf('<img id="output" src="data:image/png;base64,%s" />', base64_encode(ob_get_clean())); ?>Karakter sorunu var gibi ne yapmalıyım. teşekkürler - 19-06-2020, 23:56:24
$str = mb_convert_encoding($_str, "UTF-8", "ISO-8859-9"); veya $str = mb_convert_encoding($str, "UTF-8", "auto");
- 20-06-2020, 08:51:52teşekkür ederim, kod üzerinde uygulayabilirmisiniz dönüştürmediTheMedicus adlı üyeden alıntı: mesajı görüntüle
