Put border around partially transparent Image being drawn on CGContext
问题 I have an image with a yellow vase in the foreground and transparent background: I'm drawing it on a CGContext: CGContextDrawImage(context, CGRectMake(0, 0, 100, 100), myImage.CGImage); I can draw a shadow around it by using the following statement before CGContextDrawImage : CGContextSetShadowWithColor(context, CGSizeMake(0,0), 5, [UIColor blueColor].CGColor); But I want to put a stroke around the image, so that it'll looks like following: If I did this: CGContextSetRGBStrokeColor