On Feb 3, 2011, at 22:58, Andrew Coad wrote:
> //[[self touchClearImage] drawAtPoint:aPoint
> blendMode:kCGBlendModeNormal alpha:0.0]; // <-- see note below
This doesn't do anything -- alpha == 0 turns the source image fully transparent
(in effect), and a transparent source has no effect in this mode.
> [[item displayImage] drawAtPoint:aPoint
> blendMode:kCGBlendModeNormal alpha:[[item
> displayImageAlpha] doubleValue]]; // <-- alpha is in fact 1.0
According to CGContext.h (I looked in the Mac OS X SDK version because it was
handy, but I assume the iOS formulas are the same), blendMode
kCGBlendModeNormal is:
R = S + D*(1 - Sa)
which obviously blends the source into the destination. You probably want
either kCGBlendModeCopy:
R = S
or kCGBlendModeSourceAtop:
R = S*Da + D*(1 - Sa)
depending on what you want to happen to transparency within the new image.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]