Re: scrolling an NSImageView leaves tracks
Re: scrolling an NSImageView leaves tracks
- Subject: Re: scrolling an NSImageView leaves tracks
- From: John Pannell <email@hidden>
- Date: Sat, 9 Apr 2005 15:50:40 -0600
Hi Geoff-
I have successfully used the following technique to eliminate tearing artifacts when scrolling a matrix of images; I imagine it should work with a single image as well.
1. Tell the NSScrollView's NSClipView to post notifications when its bounds change.
2. Tell your controller object to observe such notifications.
[[[aScrollView subviews] objectAtIndex:0] setPostsBoundsChangedNotifications:YES];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(scrollChanged:) name:nil object:[[aScrollView subviews] objectAtIndex:0]];
3. In your controller's observer method, tell the NSImageView it needs display.
[anImageView setNeedsDisplay:YES];
With any luck, this will result in "clean up" after the scrolling movement to eliminate the artifacts. Hope this helps!
John
John Pannell
Positive Spin Media
http://www.positivespinmedia.com
On Apr 9, 2005, at 1:53 PM, Geoff Levner wrote:
I have an NSImageView in an NSScrollView. I can zoom in and out, scroll, load new images, and everything is fine.
Except for one thing. Sometimes, when a newly loaded image is initially framed so that it is clipped by the scroll view, scrolling leaves tracks (grey vertical or horizontal lines) where previously clipped portions of the image become visible. Zooming in or out once makes them go away. Calling the NSClipView's setCopiesOnScroll method with NO also makes the problem go away, but then, of course, scrolling is much slower.
Has anybody out there ever encountered this sort of behavior?
_______________________________________________
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
_______________________________________________
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