Plotting in cocoa

Discussion in 'Mac Programming' started by MrFusion, Sep 29, 2006.

  1. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #1
    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
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    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.
     
  3. MrFusion thread starter macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #3
    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?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    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)...
     

Share This Page