title: Getting image using UIGraphicsGetImageFromCurrentImageContext
body: <p>I am trying to understand, UIgraphicsGetImageContext() function, from my understanding, its a function, which gets the image from current bitmap context, so whenver I draw something on my canvas, and call this function, I get the image drawn, but suppose I dont draw anything then also it extracts an empty image. So I want to understand, how can we check when the canvas(CGContext) is nil.</p>
  
  <p>Below is my code which I tried, but its not working</p>
  
  <pre><code> UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO,0.0);
      [self.layer renderInContext:UIGraphicsGetCurrentContext()];
      if(UIGraphicsGetCurrentContext() == nil)
      {
          NSLog(@"NIL");
      }
      else
      {   
          m_curImage = UIGraphicsGetImageFromCurrentImageContext();  
          UIGraphicsEndImageContext();
          NSLog(@"%@",m_curImage);       
      }
  </code></pre>
  
  <p>So friends, please let me know how to get this it will be helpful to me</p>
  
  <p>Regards
  Ranjit</p>