Custom alpha drawing
I am trying to customize an image (with alpha) and end up going to apply different color tones to it. Right now I'm just trying to get it right. It might be a simple problem, but the ALPHA results in black in my image. The .png image is created from photoshop with correct alpha.
- (void) drawRect:(CGRect)area
{
[imgView.image drawInRect: area blendMode:blendMode alpha:alpha]; // draw image
}
blendMode is normal and alpha is 1.0. The image is good except for alpha, black. Any help was appreciated.
Tried another drawing method but shows black alpha and upside down (don't worry it's up top right now)
- (void) drawRect:(CGRect)area
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
// Draw picture first
CGContextDrawImage(context, area, imgView.image.CGImage);
CGContextRestoreGState(context);
}
+2
CodeMonkey
source
to share
2 answers