• 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: Fixed pattern with colorWithPatternImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixed pattern with colorWithPatternImage


  • Subject: Re: Fixed pattern with colorWithPatternImage
  • From: James Montgomerie <email@hidden>
  • Date: Sun, 5 Sep 2010 17:55:22 +0100

On 04/09/2010, at 14:52, Quincey Morris <email@hidden> wrote:
> The pattern is tiled relative to the window, not to the view. So, the 'colorWithPatternImage:' isn't a viable approach in this case.

Quincey may be right that drawing the image directly is the easier approach, but it /is/ possible to change the offset of a pattern image by altering the graphics context's pattern phase.  Before you draw:

CGFloat offset = <calculate the offset required to get the image to align at the top of the view here>;

CGContextSetPatternPhase((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], CGSizeMake(0, offset));

[Typed in Mail, so not checked for syntax errors].

Jamie._______________________________________________

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: 
 >Fixed pattern with colorWithPatternImage (From: Pessoal <email@hidden>)
 >Re: Fixed pattern with colorWithPatternImage (From: Quincey Morris <email@hidden>)
 >Re: Fixed pattern with colorWithPatternImage (From: Daniel - Area <email@hidden>)
 >Re: Fixed pattern with colorWithPatternImage (From: Quincey Morris <email@hidden>)
 >Re: Fixed pattern with colorWithPatternImage (From: Daniel Lopes <email@hidden>)

  • Prev by Date: Re: QTMovie Error -2048
  • Next by Date: Re: Fixed pattern with colorWithPatternImage
  • Previous by thread: Re: Fixed pattern with colorWithPatternImage
  • Next by thread: Re: Fixed pattern with colorWithPatternImage
  • Index(es):
    • Date
    • Thread