Re: Filling View With Pattern Image
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