FYI: Cocoa's framework scaling works great!
FYI: Cocoa's framework scaling works great!
- Subject: FYI: Cocoa's framework scaling works great!
- From: Ricky Sharp <email@hidden>
- Date: Mon, 24 Apr 2006 18:25:42 -0500
While still a work-in-progress feature on Apple's part, I've gotten
my app to be resolution-independent savvy.
For those that may not know, you can access this "developer-only"
feature of the OS by:
- launching QuartzDebug
- select "Show User Interface Resolution" from the "Tools" menu
- adjust the slider to what you want.
- launch your app and see the results.
If you're using standard Apple UI controls, things will not be too
good as most of the controls still use bitmapped-based components.
However, if you have your own controls (like my app does), you can
achieve beautiful scaling at little or no cost to you.
Since all my drawing is done with vector-based PDFs, bezier paths and
the Cocoa text system, the framework (hence the name framework
scaling) kicks in and does the right thing for you.
The only areas where I had to adjust my code (as mentioned in the
AppKit release notes) was window sizing and positioning. But that
was only a few lines of code.
A recent thread about screenshots brought up the usage of
initWithFocusedViewRect:. That not only works in Tiger, but it does
the right thing for resolution independence. My app takes a
screenshot and coverts it to grayscale to serve as a background for
"dialogs". I am still able to use direct pixel access on the
captured screenshot and apply the grayscale algorithm to it. This
works at all scaling factors.
Finally, something I thought was really cool is that NSCursor, if fed
a vector-based image, will render beautifully at all scaling
factors. Note however that I am not sure if such an NSCursor will
employ a hardware-based solution***. I haven't seen any slowdowns
when using a scalable 64x64 pt image. Although I am running on a
dual 2GHz with an ATI-9800 Pro card. Not sure what kind of hit this
will be on slower systems.
*** NSCursor will attempt to use a hardware-based solution to render
your cursor. If it cannot, it falls back to a software-based one.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden