title: How to take screenshot of a user defined rectangular area in cocos2d
body: <p>I need to take the screenshot in my <code>cocos2d</code> application. I've searched a lot, even in stack overflow. Then I found the following code:</p>
  
  <pre><code>+(UIImage*) screenshotWithStartNode:(CCNode*)stNode
  {
      [CCDirector sharedDirector].nextDeltaTimeZero = YES;
  
      CGSize winSize = [[CCDirector sharedDirector] winSize];
      CCRenderTexture* renTxture = 
      [CCRenderTexture renderTextureWithWidth:winSize.width 
                                   height:winSize.height];
      [renTxture begin];
      [stNode visit];
      [renTxture end];
  
      return [renTxture getUIImage];
  }
  </code></pre>
  
  <p>Now,</p>
  
  <p><strong>Problem:</strong> The above code gives me the entire screenshot. But I am in need of the screenshot of a custom are, such as, within a <code>CGRect(50,50,100,200)</code>.</p>
  
  <p>Can anyone please help me..? Thanks...</p>