title: UIImage vs NSImage: Drawing to an off screen image in iOS
body: <p>In mac osx (cocoa), It is very easy to make a blank image of a specific size and draw to it off screen:  </p>
  
  <pre><code>NSImage* image = [[NSImage alloc] initWithSize:NSMakeSize(64,64)];
  [image lockFocus];
  /* drawing code here */
  [image unlockFocus];
  </code></pre>
  
  <p>However, in iOS (cocoa touch) there does not seem to be equivalent calls for UIImage. I want to use UIImage (or some other equivalent class) to do the same thing. That is, I want to make an explicitly size, initially empty image to which I can draw using calls like <code>UIRectFill(...)</code> and <code>[UIBezierPath stroke]</code>.</p>
  
  <p>How would I do this?</p>