On Apr 22, 2011, at 12:33 AM, Warren Lanford wrote:
> If you have any further suggestions on this, they'll be greatly appreciated.
Hi Warren,
Core Graphics is definitely different from QuickDraw and is very robust and IMO better than QuickDraw overall. To use CG or not can only be answered by you. If the code ever needs to move to Cocoa, use of CG is *not* an issue. In fact, Cocoa uses CG primitives to render content( see Apple’s "Cocoa Drawing Guide" the section "Incorporating Other Drawing Technologies" ). Don’t forget about Apple’s docs. They are typically well-written and explain things well. If your code has a limited life span and doesn’t need to be prepared for the future, the GraphicImporter/Exporter calls may still be used but the code will need to create FSSpecs( not difficult at all ) as mentioned in my prior post. Robert and Ken have provided good demos ( and more are in FB Examples ), while I’m trying to help you with strategy. Personally, I hate writing a lot of code to find out a year later it needs to be re-written. I do my best to insulate my code from future changes because it is ultimately less work. Not everyone chooses this path. One of my clients has a program that is used several times a year and I help adapt it ( first to OS X many years ago and soon to running native Intel ) as it encounters a new obstacle. Picking the right strategy and technology is important and asking some questions like the following should help:
(1) How is the program used and by whom? (i.e. is it personal use or used by clients and/or corporations )
(2) Is the program part of some critical/important production work?
(3) Is the program a one-shot or limited use program ( example: data conversion programs are often used and discarded )
Clearly, personal use, one-shot programs don’t need to be state of the art. Programs written for clients or production work tend to have a life of their own and live far beyond even what the author expects. Some of the code I wrote in the mid-1970s to 80s is still running in production and code written by other programmers is also still in production from that era.
Right now using Cocoa and Objective-C is the best longevity strategy. Since we all use FB and Carbon, the next best longevity strategy is to use the technologies that transfer easily into Cocoa such as the Core Foundation and Core Graphics frameworks.
Brian S