On 04/09/2010, at 14:52, Quincey Morris <quinceymor...@earthlink.net> 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 (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

Reply via email to