title: Converting the drawn view into UIImage and add to UIImageView in iphone
body: <p>I have app in which i am making sign with finger it works fine and it draws line but i want to save those lines drawn signature as image in ImageView to show screen but it is not showing i am using following code.</p>
  
  <pre><code>-(void)onSignButtonClick
  {
  
      signatureView=[[UIView alloc] initWithFrame:CGRectMake(100,100,800,500)];
  
      signatureView.backgroundColor=[UIColor blackColor];
  
      [self.view addSubview:signatureView];
  
      UIButton*OkButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
      [OkButton setFrame:CGRectMake(100,420,200,40)];
      [OkButton setTitle:@"OK" forState:UIControlStateNormal];
      [OkButton addTarget:self action:@selector(onOKButtonClick) forControlEvents:UIControlEventTouchUpInside];
      [signatureView addSubview:OkButton];
  
      drawScreen=[[MyLineDrawingView alloc]initWithFrame:CGRectMake(10,10,700,400)];
      [signatureView addSubview:drawScreen];
      [drawScreen release];
  }
  
  
  - (UIImage *)captureView {
  
      //hide controls if needed
          CGRect rect = [signatureView bounds];//use your signature view's Rect means Frame;
          UIGraphicsBeginImageContext(rect.size);
          CGContextRef context = UIGraphicsGetCurrentContext();
          [self.view.layer renderInContext:context];   
          UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
          UIGraphicsEndImageContext();
          return img;
  }
  
  -(void)onOKButtonClick{
  
  
      signatureView.hidden=YES;
  
      [self captureView];
  
        logoImageView.image=signatureImage;
  }
  </code></pre>