开发者

UIImageView vs UIView's drawRect for displaying images

What is the faster way to display images (to maximize FPS)? Setting the image-property of an UIImageView or calling drawAtPoint of the image within the drawRect method (in conjunction with the setNeedsDisplay method of the corresponding UIView, assuming that the dimensions of the image matches those of the 开发者_StackOverflow中文版UIView)?


While I haven't tested it, I think it is drawAtPoint, especially if you are drawing multiple images into a view. The overhead of multiple views will be avoided. If you are just doing a simple animation however UIImageView can be a simple way to do it (see http://appsamuck.com/day2.html). If fps really matters for your application and you have a lot of moving objects, you will want to look into game development tutorials.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜