Re: Color with pattern image
Re: Color with pattern image
- Subject: Re: Color with pattern image
- From: Rob Keniger <email@hidden>
- Date: Mon, 10 Aug 2009 09:50:37 +1000
On 10/08/2009, at 8:18 AM, Mirko Viviani wrote:
I'm using -[NSColor colorWithPatternImage:] to draw a background
pattern image and I want to set
a constraint for the drawing starting rectangle.
The docs says that "The image is tiled starting at the bottom of the
window"
...
Is there any way to change this behaviour?
Yes, you can use the -setPatternPhase: method of NSGraphicsContext to
draw the pattern in the location you expect. You have to calculate the
offset yourself.
Have a look at Dave Batton's excellent DBBackgroundView for an example:
http://www.mere-mortal-software.com/blog/details.php?d=2007-01-16
--
Rob Keniger
_______________________________________________
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