Re: How to repaint a canvas?

Stefano Mancini (
Fri, 13 Dec 1996 17:39:55 +0100

To subscribers of the xforms list from Stefano Mancini <> :

Peter Reich wrote:
> To subscribers of the xforms list from (Peter Reich) :
> Hello,
> What is the recommended way to repaint a canvas? Do i have to call the expose
> function or is there another way to do it? The problem i have is like this:
> I have to implement a zoom function. Every time i press a zoom button, the
> canvas has to be redrawn with a new scale factor. What is best way to achieve
> this.
> (oh, i forgot the questionmark, sorry)
> Thanks for your help
> Peter
> To unsubscribe, send the message "unsubscribe" to
> or see

I think that the only way is to repaint everything!

So the problem is not in how to repaint but in which is the best choice
for the data structure that handle all the graphics objects !!

Maybe a linear list, but depends a lot from the problem kind....

If your problem is OVERLAY a TEMPORARY graphic on a REAL graphic, than
exist a lot of possible solutions, depending again on problem and on
hardware configuration. I list some of these:

1. Overlay with different color and color planes. (You need almost
a PseudoColor monitor)
2. Using two pixmaps and swapping between (good when you need to
simulate movement, but not so much when you have to redraw only
a part of the graphics

Hoping to be useful,
Best Wishes and Happy New Year.


Dott. Stefano Mancini
Institution: University of PISA - Department of Physics
Business Address: Via Vecchia Livernese - 56010 S.Piero a Grado (Pisa)
Business Phone: +39 50 880.344
Business Fax: +39 50 880.350
To unsubscribe, send the message "unsubscribe" to or see