Re: Re: How do I pattern an image in a view w/o "scrolling"?
Re: Re: How do I pattern an image in a view w/o "scrolling"?
- Subject: Re: Re: How do I pattern an image in a view w/o "scrolling"?
- From: "Michael Ash" <email@hidden>
- Date: Fri, 28 Jul 2006 12:36:43 -0400
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:
This email sent to email@hidden