Heya,
I've got an image (a single frame GIF, no animation), that has transparancy.
But when I add the UIImage to my IBOutlet UIImageView as a subview, the transparant part of my image is displayed black!?
This is how I made the transparant part of my image masked:
So the 'colormasking' part works, the parts that I expected to be transparant become black.
Now I just want the black to become transparant
...
Any help?
I've got an image (a single frame GIF, no animation), that has transparancy.
But when I add the UIImage to my IBOutlet UIImageView as a subview, the transparant part of my image is displayed black!?
This is how I made the transparant part of my image masked:
Code:
float trans = [[GIF_transparancies objectAtIndex:index] floatValue]; // This gets the color that should be transparant.
CGFloat colorMasking[6] = {trans, trans}; // Adding this 6 times (R, G , B) does not help/work, same effect -> black parts instead of transparant.
UIImage *image = [UIImage imageWithData:[GIF_framesData objectAtIndex:index]]; // Get the GIF and make an image out of it.
CGImageRef imageWithTransparancy = CGImageCreateWithMaskingColors([image CGImage], colorMasking); // Color mask it.
return [UIImage imageWithCGImage:imageWithTransparancy]; // Turn it back into a UIImage
So the 'colormasking' part works, the parts that I expected to be transparant become black.
Now I just want the black to become transparant
Any help?