The ultimate Core Graphics resource


Liberate your application

Now works on all architectures, and without hiccups!

Can’t get enough of window transitions? Love a little eye candy? Well, you’re in luck. The Core Graphics Framework and Xcode Project Template make adding the fantastic Core Graphics function to your app a breeze. In fact, it’s even more complete than the tutorial, and already has more features in it before you write a single line of code! It doesn’t stop there, however. This framework powerful enough to use the genie effect. That’s right. That awesome Mac OS X transform you can get when you minimize an application. Core Graphics contains a wealth of resources. You really have to check it out.

Point. Click. Zoom!

The CGS Framework is a an implementation of transitions, transforms and everything Core Graphics. It includes the definitions and implementations for the methods, so that using a transition or transform is as simple as calling a single method! For example, scaling a window is as simple as a “- scale: about:” call on the window, and rotating it just requires a single “- rotate: about:”. In the same way, Core Graphics is laid bare with this framework, for you to utilize at your pleasure!

Don't lift a finger

The framework does all the work for you, but even then, it gets simpler. Source for a sample app is included which means that you can create Core Graphics projects straight away by building on top of it. This saves you, the developer time in adding and linking the Framework, and reading and implementing the Core Graphics class in Interface Builder, as well as adding the framework to your project. A single double-click on the sample project and it’s all done for you. What more could you ask? Download a copy and check it out today. You’ll be surprised how powerful it is.

Gimme already!

Now a universal binary for your developing pleasure!

CGS Framework + Sample App

Once downloaded, open CoreGFX.app to view some of the possible effects. You can copy the source folder to hard drive if you need to build a Core Graphics enabled app. Enjoy the wonderfulness, and I hope you have fun!


Any queries, fire away.

Make sure you understand that some of the functions of Core Graphics used in this framework are undocumented, internal APIs that Apple haven’t released. (Calm down. It’s not illegal). Having said that, apps like Quicksilver would be quite bland without the use of the undocumented Core Graphics functions, so exercise your discretion.

This project relies heavily on work by Wade Tregaskis and his Rotating Windows.

© 2006 Ankur Kothari.


Back to Top ↑

32 Comments so far

Leave a comment

Pages: « 1 [2] Show All

  1. 3

    Logan, it’s great to hear that you’re finding this site useful. Do let me know when your application is done, I’d love to see it.

    About the framework, are trying to link just the framework, or have you dragged the “Cocoa Core Graphics Application” folder to Macintosh HD/Library/Application Support/Apple/Developer Tools/Project Templates/Application/ ? Once that is done and you click File -> New Project you should see a “Cocoa Core Graphics Application” project which should be able to build and run without errors immediately.

    EDIT: I’ve just tried building for Intel and it failed miserably. Give me a couple of hours to try and hunt this bug down.

  2. 4

    Core Graphics is an undocumented, internal API that Apple haven’t released

    This is misleading. Core Graphics is a public API (CGPath, CGImage, and so on) it’s just that you’re using the private parts of the framework.

    You should probably make this clear in the demo and docs so new Mac programmers don’t get the wrong message.

    As I said in the other thread, though, great work.

  3. 5

    Yeah, I did think I sounded a little negative there, but people were arguing the use of Core Graphics.

    It’s changed now, hope it worked for you. I’m still trying to fix that Intel bug. I think I’ve almost got it. Just another reason to get a MacBook Pro, I guess.

  4. 6

    Ankur: It might, just might be because it’s not compiled as a universal binary :P Getting info on the CGS binary in the framework reveals that it’s a “Document (PowerPC)”.

    In the build settings for the framework, just set “Architectures” to “ppc i386″.

  5. 7

    Joachim, that’s I’ve been trying to do for the past three hours. It just doesn’t want to compile as universal. I’m posting the < href=”http://dev.lipidity.com/wp-content/uploads/2006/10/cgs-framework-source.zip” title=”Source code for the framework”>source for the framework up if anyone wants a crack at it.

  6. 8

    Oh! I see. I apologize for the somewhat rude tone :/ I’ll have a look at the code…

  7. 9

    No problem. “As iron sharpens iron, so one man sharpens another.”

    :)

    Good luck finding a fix, or what the problem actually is. I guess that’s the trouble with undocumented stuff; it’s impressive, but takes work to iron out the bugs.

  8. 10

    Haha! I’ve got it! :D

    Watch for another post coming soon…

  9. 11

    Should now be 99.9% bug-free until another bug is found. :P

    Feel free to use this code to dazzle your clients / users, and let me know how much fun you have with it.

  10. 12

    What was wrong? I looked at the code for a jiffy, but didn’t find anything.

  11. 13

    Thanks for looking. The problem wasn’t in the code, it was in some project settings. I initially had an executable and framework target in the same project, then when I deleted the executable to build just the framework, something must have messed up.

    The framework worked when I rebuilt another project from scratch.

  12. 14

    I’ve been playing around with this and it’s definitely pretty sweet. I haven’t figured out yet though how to apply the effects to individual views instead of windows. Is this possible? Thanks again!

  13. 15

    Also, would you care to comment on what impact Core Animation will have on these frameworks? Will they be totally obsoleted, or what?

  14. 16

    Stephen, most Core Graphics effects are only allowed on windows, and I’m not aware of any hack that would allow you apply these on individual views as you’re required to pass the window number to implement the transition. For effects on individual views, it’s probably best to use Core Image Filters, and a sample app with both Core Image and Core Graphics effects is available here.

    Now, regarding Core Animation, you have to realize that Core Graphics is written by Apple. It wont become obsolete with the release of Core Animation, because

    Using Core Animation, Mac developers can create snazzy animations in their programs using different media types, such as text, 2D graphics, OpenGL renderings, and video, simultaneously.

    In fact, Core Animation itself is not a medium for creating effects, but rather for integrating things like video, and OpenGL. That’s my understanding, anyway.

    Either way, Core Graphics is not about to become obsolete ;)

  15. 17

    There is a quick fix if you want use those CoreGraphics animations on a view:
    -you hide the view
    -you make a borderless window and you change the content view to your view
    -you apply your transition
    -you delete the window
    -you display your view

    Should work?

  16. 18

    Very good idea. I think that’ll actually work! Can’t believe I didn’t think of it :P

  17. 19

    ;) I seem not to be that stupid after all…
    You could even implement this in the framework…

  18. 20

    I considered doing that yesterday, but decided against it because of the (assumed) performance overhead. But maybe by using the same window over and over (ala the field editor for text) this could be minimized. I’m definitely going to do this!

  19. 21

    Definitely let me know if you get any results.

  20. 22

    It works on Intel, building by it self separately is a bit shaky, but i managed to backup the download and renovate the application and build it into my personal one. It was hard but managed to conceal them in a box in a drawer belonging to NSWindow.

  21. 23

    I was really looking for it for a long time! Thanks very much! :) But as i see, there is a little bug with shadow, it disappears when transaction begins :( Any ideas, how to fix that?

  22. 24

    It might be possible to force the shadow to stay during the transition. I think I recall doing this sometime, but I’m not certain. If I find anything I’ll post it up here.

  23. 25

    Awesome! Thanks a ton for putting this out there for us!

  24. 26

    Any way to use the Genie effect on an NSView inside a window? Basically doing an NSView to NSView effects instead of NSWindow to NSWindow.

  25. 27

    Thanks, Chris. I haven’t used undocumented Core Graphics functions on views at all, but Seoxys’ suggestion sounds reasonable.

Pages: « 1 [2] Show All

RSS feed for comments on this post. TrackBack URI

Leave a comment

Comments may be edited for formatting.