• 19-06-2020, 20:46:26
    #1
    PDO 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
    #2
    Örnek burada var.

    https://phppot.com/php/how-to-conver...age-using-php/
  • 19-06-2020, 20:53:46
    #3
    carasar adlı üyeden alıntı: mesajı görüntüle
    Bunu kullandım ama php sayfada kullandığımda patlıyor.. resim atayım hemen
  • 19-06-2020, 21:01:08
    #4
    Kimlik 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:42
    #5
    carasar 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
    #6
    $str = mb_convert_encoding($_str, "UTF-8", "ISO-8859-9");
    
    veya
    
    $str = mb_convert_encoding($str, "UTF-8", "auto");
  • 20-06-2020, 08:51:52
    #7
    TheMedicus adlı üyeden alıntı: mesajı görüntüle
    $str = mb_convert_encoding($_str, "UTF-8", "ISO-8859-9");
    
    veya
    
    $str = mb_convert_encoding($str, "UTF-8", "auto");
    teşekkür ederim, kod üzerinde uygulayabilirmisiniz dönüştürmedi