Hello! I have a transparent image that I draw strokes into and later on I draw this image over a textured background using CGContextDrawImage
. The problem is that even the parts that have been stroked by a pure black color ([UIColor blackColor]
) come out as slightly transparent on the textured background.
The stroke looks like this:
CGContextSetStrokeColorWithColor(context, /* some CGColor */);
CGContextSetFillColorWithColor(context, /* same CGColor */);
CGContextSetBlendMode(context, kCGBlendModeNormal);
CGContextSetLineWidth(context, strokeWidth);
CGContextSetLineCap(context, kCGLineCapRound);
// set up path points, stroke path
Then I take the transparent image with strokes and draw it onto the texture background:
CGContextRef context = UIGraphicsGetCurrentContext();
CGImageRef image = /* get image with strokes */;
CGRect imageFrame = CGRectMake(0, 0, /* some width */, /* some height */);
CGContextDrawImage(context, imageFrame, image);
CGImageRelease(image);
I want the strokes to be perfectly opaque. What am I doing wrong?