Re: Filling View With Pattern Image
Re: Filling View With Pattern Image
- Subject: Re: Filling View With Pattern Image
- From: Chunk 1978 <email@hidden>
- Date: Fri, 19 Jun 2009 04:29:44 -0400
hi rob, thanks for this answer. i forgot to mention that it is for
UIView on iPhone OS. i just found a super simple way of managing this
using the backgroundColor property of the view:
self.backgroundColor = [UIColor colorWithPatternImage:[UIImage
imageNamed:@"image.png"]];
On Fri, Jun 19, 2009 at 4:24 AM, Rob Keniger<email@hidden> wrote:
>
> 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
>
_______________________________________________
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