Re: Fixed pattern with colorWithPatternImage
Re: Fixed pattern with colorWithPatternImage
- Subject: Re: Fixed pattern with colorWithPatternImage
- From: James Montgomerie <email@hidden>
- Date: Sun, 5 Sep 2010 17:55:22 +0100
On 04/09/2010, at 14:52, Quincey Morris <email@hidden> wrote:
> The pattern is tiled relative to the window, not to the view. So, the 'colorWithPatternImage:' isn't a viable approach in this case.
Quincey may be right that drawing the image directly is the easier approach, but it /is/ possible to change the offset of a pattern image by altering the graphics context's pattern phase. Before you draw:
CGFloat offset = <calculate the offset required to get the image to align at the top of the view here>;
CGContextSetPatternPhase((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], CGSizeMake(0, offset));
[Typed in Mail, so not checked for syntax errors].
Jamie._______________________________________________
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