So I have the following code:
CGContextDrawImage(context, CGRectMake(100, 0, 220, self.image.size.height), self.image.CGImage);
basically I am asking CG to draw the image 100 px to the right.. now this works fine.. however to the left of the image I see a white background. How do I change this background to some other color? Say I want a black blackground
Before drawing the image, fill the rect with the desired color:
Note: Make sure the rect’s you’re drawing into width is at least the image’s width + 100