An image doesn't carry a blend mode, merely the image data. You *draw* the image in a given blend mode.
Bob On Fri, Jan 22, 2010 at 3:52 PM, Eric E. Dolecki <edole...@gmail.com> wrote: > I'm not combining two or more images, I merely would like a single uiimage > in a uiimageview to have a blend mode applied to it that works so that no > matter what is beneath it, there will be a blend mode applied. > > Is this not possible? > > > On Fri, Jan 22, 2010 at 10:43 AM, Bertil Holmberg > <bertilholmb...@telia.com>wrote: > > > Here is a snippet that I saved for another day, perhaps it will get you > > going? > > > > Regards, > > Bertil > > > > - (UIImage *)blendOverlay:(UIImage *)topImage withBaseImage:(UIImage > > *)baseImage toSize:(CGFloat)imageSize > > { > > UIGraphicsBeginImageContext(CGSizeMake(imageSize, imageSize)); > > [baseImage drawInRect:CGRectMake(0.0, 0.0, imageSize, imageSize)]; > > [topImage drawInRect:CGRectMake(0.0, 0.0, imageSize, imageSize) > > blendMode:kCGBlendModeNormal alpha:0.5]; > > UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); > > UIGraphicsEndImageContext(); > > > > return image; > > } > > > > > Okay, how would I go about doing that? > > > > > > On Fri, Jan 22, 2010 at 9:52 AM, Luke the Hiesterman < > luket...@apple.com > > >wrote: > > > > > >> You should perform whatever blending you need to do on the image > itself > > to > > >> create a new image which you can then just put into a UIImageView like > > you > > >> would any other image. This way, you only have to blend once, and then > > it's > > >> just image that can be straight drawn rather than performing a > blending > > >> algorithm every time your image has to draw. > > > > > > > _______________________________________________ > > > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > > > 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/edolecki%40gmail.com > > > > This email sent to edole...@gmail.com > > > > > > -- > http://ericd.net > Interactive design and development > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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/tom.davie%40gmail.com > > This email sent to tom.da...@gmail.com > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com