{"id":1452,"date":"2012-09-26T14:15:55","date_gmt":"2012-09-26T21:15:55","guid":{"rendered":"http:\/\/www.wellgolly.com\/?p=1452"},"modified":"2012-09-26T14:16:03","modified_gmt":"2012-09-26T21:16:03","slug":"updating-apps-in-ios-retina-display","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=1452","title":{"rendered":"Updating apps in iOS &#8211; Retina Display"},"content":{"rendered":"<p>I have a bunch of small icons that I use in my apps and for all of them, I just doubled the size of the image and added @2x to the name. For most of the icons that was all I needed to do because the frame I created for the images was a fixed number of points. iOS scaled the images appropriately. For some images I determined the frame size by looking at the size of the image. For those images I had to divide by the scale factor or the images would be twice as big as I wanted. e.g.<\/p>\n<p><pre><code class=\"\u2019smaller\u2019 preserve-code-formatting\">\nCGFloat deviceScale = [UIScreen mainScreen].scale;\ncButton.frame = CGRectMake(0, 0, cImage.size.width\/deviceScale, cImage.size.height\/deviceScale);\n<\/code><\/pre><\/p>\n<p>All of my games rely heavily on graphics and they are large\u2014too large to include both a normal size and @2x version. I can get the device to display the images as if they were labeled @2x by a simple conversion. <\/p>\n<p><pre><code class=\"\u2019smaller\u2019 preserve-code-formatting\">\nif ([[Utilities deviceType] isEqual:@&quot;iPhone Retina4&quot;] || [[Utilities deviceType] isEqual:@&quot;iPhone Retina35&quot;] ) {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pictLeft&nbsp;&nbsp;= [UIImage imageWithCGImage:pictLeft.CGImage&nbsp;&nbsp;scale:2 orientation:pictLeft.imageOrientation];\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pictRight = [UIImage imageWithCGImage:pictRight.CGImage scale:2 orientation:pictRight.imageOrientation];\n&nbsp;&nbsp;&nbsp;&nbsp;}\n<\/code><\/pre><\/p>\n<p>This works on the iPhone because the images are way bigger than they need to be. On the iPad they aren&#8217;t more than twice the number of pixels that are displayed, so it doesn&#8217;t work.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a bunch of small icons that I use in my apps and for all of them, I just doubled the size of the image and added @2x to the name. For most of the icons that was all I needed to do because the frame I created for the images was a fixed &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=1452\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Updating apps in iOS &#8211; Retina Display<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-1452","post","type-post","status-publish","format-standard","hentry","category-ios"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/1452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1452"}],"version-history":[{"count":0,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/1452\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}