iOS Quartz 2D Graphics Filled Irregular Shapes Blurry

I'm drawing irregular shapes using Core Graphics on a retina display. I do this by creating a UIBezierPath with 5 to 10 random points. In drawRect I stroke the path and fill it using solid red colour.

My problem is that diagonal lines in my drawing doesn't appear to be sharp.

I have tried anti aliasing but if anything this makes it appear worse. I have experimented with different line widths, not stroking, not filling, but I can not seem to get a really sharp diagonal line.

For comparison I created a similar shape in Photoshop (using similar size) and saved that as PNG. If I display that PNG on iOS it looks much sharper.

What can I do to make my shape that I create in code look sharp?


确保你的CGPoint被四舍五入到最接近的整数值。

链接地址: http://www.djcxy.com/p/61690.html

上一篇: 从WPF中的形状(C#代码)省略边缘?

下一篇: iOS石英2D图形填充不规则形状模糊