开发者

Is there something special I must know when drawing images in core graphics?

开发者 https://www.devze.com 2023-01-16 22:04 出处:网络
Before the retina display came to iOS, I\'ve developed some controls which are drawn using stretchable images and lots of core graphics code.

Before the retina display came to iOS, I've developed some controls which are drawn using stretchable images and lots of core graphics code.

Now I tested it on a retina display device, and the graphics are misplaced and distorted. Everything else that's loaded with @2x suffix and UIImage imageNamed works fine.

I assume there must be some special considerations when using images in core graphics. For example, I obtain 开发者_如何学JAVAthe CGImage from an UIImage very often.

Does anyone know?


UIImage is a facade on top of CGImage (and IOSurface as a private API). Since CGImage has no concept of scale, it will reflect the actual size of the image's buffer--for @2x images, the CGImage dimensions will be twice what the UIImage's size are.

0

精彩评论

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