Mac Cocoa |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Sep 18, 2010 12:38 am Post subject: Scaling - retina display |
|
|
iphonedevbook.com - Updating Code in Chapter 4 for iPhone 4?
"Quartz 2D and OpenGL APIs are in pixels, while UIKit APIs are generally
in points. So you will need to take care to use the correct metrics and sca-
le when appropriate.
...
The problem is that maybe some day we get a retina display that has a
different resolution than we have today. Then all your code breaks again.
Imagine that maybe that some near future version of iPad introduces a
display that has a scale factor of 1.5." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Sep 18, 2010 12:39 am Post subject: |
|
|
MF - iPhone 4 - Retina Screen Implications
"In some of our apps some buttons are pre-rendered (including the
text) and some are native... so I'm thinking - This will look a bit odd
on the iPhone 4". |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Oct 07, 2010 1:09 am Post subject: |
|
|
Paul Solt - iOS: Converting UIImage to RGBA8 Bitmaps and Back
"The issue with iPad is that the imageWithCGImage:scale:orientation:
selector doesn’t exist on iOS 3.2, most likely it will on iOS 4.2, so the
following code should be safe.
float scale = [[UIScreen mainScreen] scale]; will provide the correct scale
factor for the device."
Code: | // Support both iPad 3.2 and iPhone 4 Retina displays with the correct scale
if([UIImage respondsToSelector:@selector(imageWithCGImage:scale:orientation:)]) {
float scale = [[UIScreen mainScreen] scale];
image = [UIImage imageWithCGImage:imageRef scale:scale orientation:UIImageOrientationUp];
} else {
image = [UIImage imageWithCGImage:imageRef];
}
|
"Grab the two files here or the sample Universal iOS App project..." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
|