CropImage:to:andScaleTo: 和 StraightenAndScaleImage() 的现有实现?
我正在编写代码来使用 UIImagePickerController。 Corey 之前发布了 一些不错的示例代码SO 与裁剪和缩放相关。 但是,它没有 CropImage:to:andScaleTo: 的实现,也没有 StraightenAndScaleImage() 的实现。
它们的使用方式如下:
newImage = [self cropImage:originalImage to:croppingRect andScaleTo:scaledImageSize];
...
UIImage *rotatedImage = straightenAndScaleImage([editInfo objectForKey:UIImagePickerControllerOriginalImage], scaleSize);
因为我确信有人一定使用与 Corey 的示例代码非常相似的东西,所以可能有这两个函数的现有实现。 有人愿意分享吗?
I'm writing code to use UIImagePickerController. Corey previously posted some nice sample code on SO related to cropping and scaling. However, it doesn't have implementations of cropImage:to:andScaleTo: nor straightenAndScaleImage().
Here's how they're used:
newImage = [self cropImage:originalImage to:croppingRect andScaleTo:scaledImageSize];
...
UIImage *rotatedImage = straightenAndScaleImage([editInfo objectForKey:UIImagePickerControllerOriginalImage], scaleSize);
Since I'm sure someone must be using something very similar to Corey's sample code, there's probably an existing implementation of these two functions. Would someone like to share?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您检查链接到的帖子,您会看到一个指向苹果开发论坛的链接,我在其中获得了一些代码,以下是您询问的方法。 注意:我可能对数据类型进行了一些更改,但我不太记得了。 如果需要的话,调整对你来说应该是微不足道的。
}
}
If you check the post you linked to, you'll see a link to the apple dev forums where I got some of this code, here are the methods you are asking about. Note: I may have made some changes relating to data types, but I can't quite remember. It should be trivial for you to adjust if needed.
}
}