【发布时间】:2018-11-20 13:22:44
【问题描述】:
我正在尝试使用 php 和 gd 库制作表单。 表单包含一个带有透明包装的 png 标志。 现在我有 3 个问题:
当我制作边框时,我想将徽标放在顶部角落 图片,它不再是透明的背景了
我使用波斯字体并使用 imagettftext 函数。它显示了 字符,但在波斯语中,我们已经合并了单词,但它显示 字符分隔
- 如何绘制圆角边框
这是我的代码:
$fontSize=4;
$width = imagefontwidth($font) * strlen($string)+10 ;
$height = imagefontheight($font) ;
$handle = ImageCreate (800, 400) or die ("Cannot Create image");
$logo = imagecreatefrompng( 'Logo.png' );
$bg_color = ImageColorAllocate ($handle, 255, 240, 250);
$txt_color = ImageColorAllocate ($handle, 0, 0, 0);
$title="فرم قرارداد";
$font = "IRANSans.ttf";
$title_size = 18;
imagettftext( $handle, $title_size, 0, 620, 100, $txt_color, $font, $title );
$black = imagecolorallocate($handle, 0, 0, 0);
imagerectangle($handle, 20, 20, 780, 380, $black);
imagecopy($handle, $logo, 10, 10, 0, 0, 161, 160);
header('Content-Type: image/png');
imagepng($handle);
【问题讨论】: