title: ipad app sending image to photo library does not capture background
body: <p>I have an app that allows writing on a variety of background colors. When I invoke the method to capture the writing to the photo library, I get the writing but without any background color.</p>
  
  <p>I could use some help to figure out why..</p>
  
  <p>I draw the background color simply enough with:</p>
  
  <pre><code>drawImage.backgroundColor = [UIColor someColor];
  </code></pre>
  
  <p>drawImage is defined as a <code>UIImageView</code>.</p>
  
  <p>I write to drawImage ok:</p>
  
  <pre><code>UIGraphicsBeginImageContext(self.view.frame.size);
      [drawImage.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
      CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
      CGContextSetLineWidth(UIGraphicsGetCurrentContext(), brush);
      CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), red, green, blue, 1.0);
      CGContextBeginPath(UIGraphicsGetCurrentContext());
      CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
      CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y);
      CGContextStrokePath(UIGraphicsGetCurrentContext());
      drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
      savedImage.image = drawImage.image;
      UIGraphicsEndImageContext();
  </code></pre>
  
  <p>and writing to the photo library is done like this:</p>
  
  <pre><code>UIImageWriteToSavedPhotosAlbum(drawImage.image, self, nil, nil);
  </code></pre>
  
  <p>I would appreciate any advice.</p>
  
  <p>Thanks</p>