• 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: Filling View With Pattern Image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Filling View With Pattern Image


  • Subject: Re: Filling View With Pattern Image
  • From: Rob Keniger <email@hidden>
  • Date: Fri, 19 Jun 2009 18:24:06 +1000


On 19/06/2009, at 6:14 PM, Chunk 1978 wrote:

i have this image ("image.png") that i would like to tile throughout
the view...

i've read the Quartz 2D programming guide... ok, ok, i breezed thru
it, i admit... but i couldn't seem to find an easy way of repeating an
image through out a view without actually drawing the image
programatically...


It's actually a little complicated, you need to create an NSColor instance using a pattern image and then when you draw it you need to set the patternPhase of the current NSGraphicsContext so that your image is drawn in the correct place.

Have a look at Dave Batton's excellent DBBackgroundView:

http://www.mere-mortal-software.com/blog/details.php?d=2007-01-16&c=show

--
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


  • Follow-Ups:
    • Re: Filling View With Pattern Image
      • From: Chunk 1978 <email@hidden>
References: 
 >Filling View With Pattern Image (From: Chunk 1978 <email@hidden>)

  • Prev by Date: Filling View With Pattern Image
  • Next by Date: Re: Filling View With Pattern Image
  • Previous by thread: Filling View With Pattern Image
  • Next by thread: Re: Filling View With Pattern Image
  • Index(es):
    • Date
    • Thread