gpt4 book ai didi

ios - 裁剪图像中心

转载 作者:可可西里 更新时间:2023-11-01 00:56:15 27 4
gpt4 key购买 nike

<分区>

我想通过获取 x1、x2、y1、y2 的值​​将肖像/风景图像裁剪为中心完美正方形图像。怎么做?

let x = pickedImage.size.width
let y = pickedImage.size.height

// Portrait image
if(pickedImage.size.width < pickedImage.size.height){
//crop image and get value of x1,x2,y1,y2
}
//Landscape image
else if(pickedImage.size.width > pickedImage.size.height) {
//crop image and get value of x1,x2,y1,y2
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com