Can I edit the pixels of the UIImage's property CGImage

前端 未结 7 1409
野趣味
野趣味 2020-11-28 05:04

UIImage has a read-only property CGImage. I have to read its pixels to a memory block and edit them and then make a new UIImage to replace the old one. I want to know if th

相关标签:
7条回答
  • 2020-11-28 05:37

    Change the NSData *data line, in Shaun's answer, to this and it works perfectly in iOS7!

     NSData *data        = (NSData *)CFBridgingRelease(CGDataProviderCopyData(CGImageGetDataProvider(imageRef)));
    
    0 讨论(0)
提交回复
热议问题