[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow Image scrolling

From: Fred Kiefer
Subject: Re: Slow Image scrolling
Date: Sun, 10 Mar 2002 21:14:04 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:0.9.4) Gecko/20011019 Netscape6/6.2


Ian Jones wrote:

I have a problem with scrolling large image attachments. I regularly recieve quite large image files attached to my email, someone recently sent a 270kb .jpg attachment and even on my dual celeron 500 it kept stopping trying to scroll through it and my CPU usage was up to 80%. I have talked to some other people about this in the #GNUstep IRC channel who have experienced the same problem with ImageViewer and Ink.app and various image types. Does anyone have any ideas as to what is causing this and how it could be improved?

The problem here is that NSImageView relies on the NSControl method drawRect: when doing a redraw. This basically ignores the given rectangle and redraws the full cell. That way an image embedded into a scroll view will always draw the full contents, even if only part is visible. And to make things worse, the scroll view will also attempt to copy parts of the image over, while you scroll. NSImageView and NSImageCell are just not designed to be but into a scroll view (The same is true for all other control and cell subclasses).

What can be done about this? Not much, as long as you are using a NSImageView. But you could write another subclass of NSView, that would implement drawRect: in a more clever way and put that into the scroll view. As long as you dont need a border or image scaling, this should be fairly simple usinge [NSImage compositeToPoint:fromRect:operation:].

I hope this helps


reply via email to

[Prev in Thread] Current Thread [Next in Thread]