title: Creating images from views, strings, etc
body: <p>Ok so I have a problem. I have a method that is called imageFromText, it requires one parameter, the string itself, and it returns a NSImage. I also have another one which is called: imageFromView, this one basically have to "take a screenshot" of the view and return a NSImage, it also has only one parameter, the view itself. So it looks like this:</p>
  
  <pre><code>-(NSImage*)imageFromText: (NSString*)text {
  
  
  }
  
  -(NSImage*)imageFromView: (NSView*)view {
  
  
  }
  </code></pre>
  
  <p>There's only one problem, I have no idea how to do this. Well so, I spent my afternoon searching around and I didn't find nothing. I've tried, to the second one, a method dataWithPDFInsideRect, but obviously, this method was not made to this propose. Please help me out!. 
  PLEASE NOT: I'M NOT ASKING FOR THE CODE READY. LIKE THE OLD DICTATION (IN MY COUNTY): DON'T GIVE THEM THE FISH, THEACH THEM HOW TO FISH. (TRANSLATED).</p>