开发者

UIImagePNGRepresentation in monochrome

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜