所以,我有这个代码将图像放在图像的最右边。
现在我想完全这样做,但是在左下角。只是不能让电线正确。有什么帮助吗?
<?php
$main_img = "image_path";
$logoimage = "logo_path";
$padding = 0;
$opacity = 100;
$logo = imagecreatefromjpeg($logoimage);
$image = imagecreatefromjpeg($main_img);
$logosize = getimagesize($logoimage);
$logowidth = $logosize[0];
$logoheight = $logosize[1];
$image_size = getimagesize($main_img);
$dest_x = $image_size[0] - $logowidth - $padding;
$dest_y = $image_size[1] - $logoheight - $padding;
imagecopymerge($image, $logo, $dest_x, $dest_y, 0, 0, $logowidth, $logoheight, $opacity);
?>
答案 0 :(得分:4)
更改此行:
$dest_x = $image_size[0] - $logowidth - $padding;
对此:
$dest_x = $padding;