Re: Efficiency Question...
Re: Efficiency Question...
- Subject: Re: Efficiency Question...
- From: Graham Cox <email@hidden>
- Date: Tue, 06 Mar 2012 18:21:02 +1100
On 06/03/2012, at 5:40 PM, R wrote:
> I want to blend two colors as a background. I'm adding a layer using
> CAGradient layer, starting on the left with blue alpha=1. and ending
> on the right with blue alpha=0.
>
> I then add another layer using red on the left with alpha=0. and
> ending on the right with alpha=1.
>
> I wonder if it is best to draw this background, or, create a .png and
> just post it.
Is the goal to go from red to blue from left to right?
Why not add a single layer with red on the left, alpha = 1, and blue on the right, alpha = 1? I don't see why you need to composite two layers.
Drawing a gradient dynamically is probably more efficient than blitting a PNG, and will be resolution independent.
--Graham
_______________________________________________
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