Am 26.02.2006 um 02:06 schrieb Steven Paul:

I'm working on a program that has a window with a background picture. Most of the action takes place in a large canvas that I do a lot of drawing into as a result of user actions, such as clicking and dragging in that canvas. As it's getting more complex the responsiveness is substantially reduced. If I clicked on something, which will cause my program to draw it differently (so it appears selected) it takes several seconds to happen. After some investigation I realize that in response to that click I am getting a big pile of calls to the canvas' paint method.

In general, you should implement some kind of clipping, since RB doesn't
implement such a notion: Only redraw the part of a canvas, which really needs to be redrawn. A simple clipping algorithm, which simple tracks the rectangular
are newly exposed would only redraw this rectangle.

Moreover, your might review double-buffering: Draw your canvas in a non-visible
Picture and copy parts of the prepared drawing to the screen.

Both options might help, but their speedup largely depends on your special
situation.

It's as if the OS doesn't believe I've "satisfied" the paint request. If I put code in there that does nothing except let me know it's been called, then the calls never stop.

Never stops or is called over and over again? Could you add a trace
feature?

Do you probably change something in your window, which in turn forces the
window to redraw?


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to