We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如上图,自定义camera,我的实现思路: 在normalPreView上新增上、中、下三个view,点击拍照按钮,获取图片后再调用UIImage的cropImage(toRect)裁剪:但是结果不理想
BH130 - 拍照图片 img width is 485.0, height is 1050.0 BH130 - 拍照图片 resizeImg width is 485.0, height is 486.0 BH130 - 拍照图片 kwidth is 414.0
我是414 * 896的手机(xs max)
代码如下:
func cameraController(_ cameraController: CameraController, didFinishWithResult result: CameraController.Result, location: CLLocation?) { if case .image(let img) = result { BHLog("BH130 - 拍照图片 img width is \(img.size.width), height is \(img.size.height)") let resizeImg = img.cropImage(toRect: CGRect(x: 0, y: BHApp.statusBarHeight + 66~ + 87~, width: kWidth, height: kWidth), viewWidth: kWidth, viewHeight: kHeight) if let resizeImg { BHLog("BH130 - 拍照图片 resizeImg width is \(resizeImg.size.width), height is \(resizeImg.size.height)") BHLog("BH130 - 拍照图片 kwidth is \(kWidth)") // self.uploadFoodImage(img: resizeImg) } else { BHLog("BH130 - 拍照图片 resizeImg 失败") } cameraController.dismiss(animated: true) { #warning("version - 1.3.0") // self.uploadImage(editedImage: img) } } }
The text was updated successfully, but these errors were encountered:
cropImage(toRect 返回的比例,不是1:1,请问有什么方法处理吗?上网搜了一圈,都有问题!
Sorry, something went wrong.
No branches or pull requests
如上图,自定义camera,我的实现思路:
在normalPreView上新增上、中、下三个view,点击拍照按钮,获取图片后再调用UIImage的cropImage(toRect)裁剪:但是结果不理想
我是414 * 896的手机(xs max)
代码如下:
The text was updated successfully, but these errors were encountered: