0

The title mostly says it all;

I've got some mockups i am looking at, and as I try to implement them, It seems as though the custom drawing, even with a linewidth of 0.5, is not quite as sharp as the mockup appears when i preview it on my device. Can assets be sharper then what is possible to manually draw using quartz?

Sean Danzeiser
  • 9,141
  • 12
  • 52
  • 90
  • http://stackoverflow.com/questions/2634103/how-to-draw-more-precise-lines-using-core-graphics-and-calayer might be one reason for why your graphics don't look sharp. – MrMage Apr 07 '13 at 07:59

2 Answers2

0

Can assets be sharper than what is possible to manually draw using quartz?

No. If that were the case, the iOS graphics system would be spectacularly broken.

Perhaps if you showed your custom drawing code, and an image of what it outputs, we could suggest something. Also, are you working with a "Retina" device?

Kurt Revis
  • 27,695
  • 5
  • 68
  • 74
0

This is most likely because of the resolution of the screen. The MacBook Pro and iMac without Retina display have approximately 110 pixels per inch and with Retina about 220, whereas the iPhone with Retina has 326 pixels per inch.

When you do coordinates in points and use whole numbers, it is as if the iPhone is 158 pixels per inch (meaning a width of 1 will be 1/158 inches wide) while on your computer it is most likely 110 pixels per inch (which is about 1/110 inches wide). However, since you are using a width of 0.5, a non-retina screen will stay at the same resolution as a width of 1.0 would be, however your device, which is most likely retina, is displaying a line with a width of 0.5 points, which is one pixel.

Because of this, a line with a width of 0.5 points will be 1/326 inches on a Retina device, but will be about 1/110 inches on your computer, which means that the line on the device will be about 3x sharper.

Jsdodgers
  • 5,253
  • 2
  • 20
  • 36