FROM : John Pannell
DATE : Sat Apr 09 23:50:40 2005
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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/
> <email_removed>
>
> This email sent to <email_removed>
>
DATE : Sat Apr 09 23:50:40 2005
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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/
> <email_removed>
>
> This email sent to <email_removed>
>
| Related mails | Author | Date |
|---|---|---|
| Geoff Levner | Apr 9, 21:53 | |
| John Pannell | Apr 9, 23:50 | |
| Geoff Levner | Apr 10, 01:31 | |
| John Pannell | Apr 10, 04:02 | |
| Hamish Allan | Apr 10, 04:25 | |
| Geoff Levner | Apr 10, 11:36 | |
| Vince DeMarco | Apr 11, 16:00 | |
| Geoff Levner | Apr 11, 17:16 |






Cocoa mail archive

