title: Rendering CGPath as a NSImage on Mac
body: <p>I have a set of shapes which I generate using<code>CGPath</code>. I want to save all those CGPath which I have generated on the disk. Basically I want to render these CGPath as <code>NSImage</code>, so that either I can save them on disk or atleast save their <code>Base64</code> encoded string.</p>
  
  <p>Here is an example of it done on iOS - <a href="https://stackoverflow.com/questions/1836796/export-cgpath-as-jpg-or-png?lq=1">Export CGPath as JPG or PNG</a></p>
  
  <p>I am trying to do something similar on Mac. I am using <code>MonoMac</code> for this and would not mind any Objective-C answers either. I am not even looking for the code, just some hints would be enough.</p>
  
  <p>I have a CGPath as an argument to the method and the method returns NSImage. This method would be called for all the CGPath being generated in another module.</p>