Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: How do I pattern an image in a view w/o "scrolling"?



On 7/28/06, Alan Smith <email@hidden> wrote:
Glenn -
Yes. I tried that:

NSPoint visOrigin = [self visibleRect].origin;
    [[NSGraphicsContext graphicsContextWithWindow: [self window]]
setPatternPhase:NSMakePoint(visOrigin.x, visOrigin.y)];
    [[NSColor colorWithPatternImage: pattern] set];
    [NSBezierPath fillRect: [self bounds]];

It doesn't have any affect. :(

And *this*, ladies in gentlemen, is a perfect showcase on why you need to *post your code*.

~15 messages into the thread before we get any code, and it turns out
that the problem has nothing to do with the question being asked.

Whenever you say something like, "I tried X and it didn't work", post
the code that does X. It's entirely possible that you just wrote a
bug, not that your use of X is flawed. But without the code, there's
no way anybody can know that.

Your bug, by the way, is creating an entirely new NSGraphicsContext
instead of using the current one. Replace the second line of your code
with:

[[NSGraphicsContext currentGraphicsContext] setPatternPhase:...]

And if that still doesn't work, come back and *post the code you're
using* so that the rest of us have more than a snowball's chance in
hell of figuring out what's going wrong.

Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >How do I pattern an image in a view w/o "scrolling"? (From: "Alan Smith" <email@hidden>)
 >Re: How do I pattern an image in a view w/o "scrolling"? (From: "Alan Smith" <email@hidden>)
 >Re: How do I pattern an image in a view w/o "scrolling"? (From: Michael Watson <email@hidden>)
 >Re: How do I pattern an image in a view w/o "scrolling"? (From: Michael Watson <email@hidden>)
 >Re: How do I pattern an image in a view w/o "scrolling"? (From: Michael Watson <email@hidden>)
 >Re: How do I pattern an image in a view w/o "scrolling"? (From: "Alan Smith" <email@hidden>)
 >Re: How do I pattern an image in a view w/o "scrolling"? (From: Michael Watson <email@hidden>)
 >Re: How do I pattern an image in a view w/o "scrolling"? (From: "Alan Smith" <email@hidden>)
 >Re: How do I pattern an image in a view w/o "scrolling"? (From: glenn andreas <email@hidden>)
 >Re: How do I pattern an image in a view w/o "scrolling"? (From: "Alan Smith" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.