Re: UIImageView display as "multiply"?
Re: UIImageView display as "multiply"?
- Subject: Re: UIImageView display as "multiply"?
- From: "Eric E. Dolecki" <email@hidden>
- Date: Fri, 22 Jan 2010 10:29:29 -0500
This is what I have so far (my UIImageView is in a table cell, no image
below it... I'd like the blend mode to handle when I select a row in the
table (the uiimageview image should blend into the selected row color) -
what I have isn't working (shows white around edges of the image) - I also
have alternating background colors in the rows in the table so it's easy to
see some of these images with white areas around edges.
UIImage *img = [[UIImage alloc] initWithData:imageData];
CGSize size = img.size;
UIGraphicsBeginImageContext(size);
[img drawAtPoint:CGPointZero blendMode:kCGBlendModeMultiply alpha:1.0];
UIImage *blendedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
projectImageView.image = blendedImage; *//doesn't display as multiply*
What might I be doing wrong here?
On Fri, Jan 22, 2010 at 10:19 AM, Luke the Hiesterman <email@hidden>wrote:
> Create a context with UIGraphicsBeginImageContext, apply your blend, and
> get the image out of the context with
> UIGraphicsGetImageFromCurrentImageContext, and don't forget to end your
> context.
>
> Luke
>
> On Jan 22, 2010, at 6:59 AM, Eric E. Dolecki wrote:
>
> Okay, how would I go about doing that?
>
> On Fri, Jan 22, 2010 at 9:52 AM, Luke the Hiesterman <email@hidden>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.
>>
>> Luke
>>
>> On Jan 22, 2010, at 6:08 AM, Eric E. Dolecki wrote:
>>
>> > I am loading up a table with contents from an XML file and loading
>> images
>> > into some cells. Since these images were made for the web some have
>> white
>> > backgrounds. I would like to somehow set them as "multiply" as one might
>> do
>> > in Photoshop to make the white "go away". Blendmode kind of thing.
>> >
>> > Do I need to subclass UIView, set blendmode in it's drawRect, place the
>> > UIImageView in there, then apply to a cell...
>> > or is there a way I can simply set a blendmode to a UIImageView?
>> >
>> > Eric
>> > _______________________________________________
>> >
>> > Cocoa-dev mailing list (email@hidden)
>> >
>> > 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:
>> >
>> > This email sent to email@hidden
>>
>>
>
>
> --
> http://ericd.net
> Interactive design and development
>
>
>
--
http://ericd.net
Interactive design and development
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden