title: How can I change the color 'white' from a UIImage to transparent
body: <p>I've got a UIImage which is generated as a screenshot. I'm adding this object with the following code:</p>
  
  <pre><code>self.view.backgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.0];
      drawImage.backgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.0];
  
      UIGraphicsBeginImageContext(self.view.bounds.size);
      [drawImage.layer renderInContext:UIGraphicsGetCurrentContext()];
      UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
  
      CGImageRef rawImageRef=viewImage.CGImage;
      const float colorMasking[6] = {255,255,255,255,0,0}; 
      CGImageCreateWithMaskingColors(rawImageRef, colorMasking);
      UIImage *newImage = [UIImage imageWithCGImage:rawImageRef];
  </code></pre>
  
  <p>However my Image only turns white, and I'd like to have the image to be transparent on the places where it's white by using CGImageCreateMaskingColors.</p>
  
  <p>Hope someone can help me out.</p>