如何在png / jpeg图像上写下印地文?

时间:2017-02-25 08:01:33

标签: php image-processing emoji imagettftext image-text

我想用表情符号在图像上写印地文文字请帮助解决这个问题

  

हमारीबराबरीEnglish

我想在500 * 600 png / jpeg图像上面写上面文字。我试过的代码是

function screen1(){

    $image_1 = imagecreatefromjpeg("Slice/$this->folder_number/screen-1-bg.png");

    imagealphablending($image_1, true);
    imagesavealpha($image_1, true);

     //fonting

     $white = imagecolorallocate($image_1, 255, 255, 255);
     $grey = imagecolorallocate($image_1, 128, 128, 128);
     $black = imagecolorallocate($image_1, 0, 0, 0);

     $text = 'हमारी बराबरी  English';
     $font = ('Slice/font/hindi-font');
     imagettftext($image_1, 23, 0, 161, 413, $grey, $font, $text);
     imagettftext($image_1, 30, 0, 160, 434, $white, $font, $text);


    imagepng($image_1, "Slice/$this->folder_number/output/screen-1.png");
}

0 个答案:

没有答案