问题描述
我想通过 CIPhotoEffectNoir 将图像转换为灰度,但是使用后图像会旋转。我进行了很多搜索,但答案无法解决我的问题。
这是我的代码:
<div id="ad_content"></div>
之前:
之后:
我想要什么:
解决方法
创建新的UIImage实例时,请不要忘记使用原始UIImage中的scale
和orientaion
值。
return UIImage(
cgImage: cgimg,scale: image.scale,orientation: image.imageOrientation)