• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Color with pattern image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Color with pattern image (From: Mirko Viviani <email@hidden>)

  • Prev by Date: Re: Core Data - attribute to hold an array of strings
  • Next by Date: Re: [iPhone 3.0; XCode 3.1.3] Question about when views are available for manipulation.
  • Previous by thread: Color with pattern image
  • Next by thread: Re: Color with pattern image
  • Index(es):
    • Date
    • Thread