views:

68

answers:

1

Having loaded two different images I want to do the following operation and obtain image3.

image1.red * image2.alpha = image3.red
image1.green * image2.alpha = image3.green
image1.blue * image2.alpha = image3.blue

I wrote the code in the link below for Android and was basically looking for the same functionality in Objective-C/Cocoa.
http://www.ruibm.com/?p=184

Thanks, Rui

+1  A: 

Draw a rounded rectangle path and clip your image with it.

http://developer.apple.com/mac/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq%5Fimages/dq%5Fimages.html#//apple%5Fref/doc/uid/TP30001066-CH212-CJBHBCGB

Azeem.Butt
The point about the sample code isn't the rounded rectangle, it's the fact that I apply image2's (which happens to be a bitmap with a rounded rectangle) alpha to image1 colours and get a nice anti-aliased bitmap with rounded corners. I need to generalize this because image2 isn't easy to draw via code.
ruibm
Try actually clicking the link and reading the documentation before you dismiss it. See all those pretty anti-aliased masks they show you how to use? Neat, huh?
Azeem.Butt
Chill out dude! I did click the link and wanted to change my vote but stackoverflow wouldn't allow me anymore.
ruibm