Is it possible to convert a vector image into Quartz 2D code (mac) so that image can be drawn programmatically?
A:
Not easily, you would have to write all the code yourself to do this. You might like to have a look at the Opacity image editor, which allows you to generate images and export them as Quartz or Cocoa drawing code.
Rob Keniger
2010-02-12 06:34:55
I'll check it out. thanks
HiQuLABS
2010-02-12 15:16:21
+1
A:
What kind of vector image?
NSImage loads PDFs the same way it loads bitmaps.
NSImage is Quartz 2D drawing, but if you meant that you need a CGImage, NSImage in 10.6 has a method for getting one. However, CGImage is explicitly bitmap based, unlike NSImage. The parameters you pass to -[NSImage CGImageForRect:context:hints:]
will determine how the art is rasterized. It will be rasterized the same way it would be if drawing to the passed rect in the passed context.
Ken
2010-02-12 07:32:03