php生成水印,包括位置和透明度(4)
$start_w = ($old_w-$end_w)/2;
$start_h = 0;
$end_h = $old_h;
}
$width = $new_w;
$height= $new_h;
} elseif($cut == 2){ // left top 裁剪
$scale1 = round($new_w/$new_h,2);
$scale2 = round($old_w/$old_h,2);
if($scale1 > $scale2){
$end_h = round($old_w/$scale1,2);
$end_w = $old_w;
} else{
$end_w = round($old_h*$scale1,2);
$end_h = $old_h;
}
$start_w = 0;
$start_h = 0;
相关新闻>>
- 发表评论
-
- 最新评论 更多>>