I'm developing an iPod-touch app, using Objective C. I am trying to capture a drawing the user creates on the device. I am using UIImagePNGRepresentation to captu开发者_开发知识库re the data in PNG format.
I want to change the PNG data: specifically I need to change it to a monochrome image. How do I go about changing its bit depth to 1?
Regards, Brian
See this answer here for accessing the pixels.
Then, I would iterate over the data, setting the values to 0xFF.. or 0x00.. depending on a threshold.
-S!
精彩评论