View Full Version : Plotting in cocoa
MrFusion
Sep 29, 2006, 05:23 AM
Hey,
Thinking long term, what would I need to learn in order to be able to plot 2D graphs with obj-c/cocoa.
I would handle 3D graphs as 2D with a color sidebar indicated the third axis.
Performance would be an issue.
opengl?
coreimage?
something else?
Thanks
robbieduncan
Sep 29, 2006, 05:40 AM
Depending on your exact requirements I'd just use a custom view (or a custom cell if you want to add it to tables etc) and draw into that with standard Quartz.
MrFusion
Sep 30, 2006, 06:24 AM
Depending on your exact requirements I'd just use a custom view (or a custom cell if you want to add it to tables etc) and draw into that with standard Quartz.
Ok, thanks. I am reading up about quartz. It's device independent, which is great. It can write to bitmap, screen,pdf,opengl. Also nice, but is there also an easy output to png or jpg, without having to implement these formats?
robbieduncan
Sep 30, 2006, 08:24 AM
Ok, thanks. I am reading up about quartz. It's device independent, which is great. It can write to bitmap, screen,pdf,opengl. Also nice, but is there also an easy output to png or jpg, without having to implement these formats?
Fairly. Render your view into an NSImage (lock focus on the view) containing an NSBitmapImageRep (only) and then use that to get the format you want (easy)...
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.