there is a cloth size of $plat 600x300
I have first put a piece of film into the right 300x300 of this cloth
right
imagecopyresampled($plat, $xxx, 300, 0, 0, 0, 300, 300, 300, 300);
then you want to 300x300 the user"s slices to the left
.left
imagecopyresampled($plat, $src, 0, 0, 0, 0, 300, 300, $new_w, $new_h);
together, it will be a 600x300.
there is no problem
the question is ~ how to handle the user"s film?
I want to get the horizontal and vertical position of the 300x300 using "uploaded"
and then add it to the plat cloth
$src_w = imagesx($src);
$src_h = imagesy($src);
if( $src_w > $src_h){
$new_w = $src_h;
$new_h = $src_h;
}else{
$new_w = $src_w;
$new_h = $src_w;
}
the above methods will be slightly horizontally and vertically centered, but there will still be differences
but how can I find no relevant resources or practices
it is also possible that I am looking for a question
that no one has the answer?
charge
I opened an empty cloth
imagecopyresampled($plat300, $src, 0, 0, 0, 0, 300, 300, $src_w, $src_h);