Re: How to repaint a canvas?

Stefano Mancini (mancini@galileo.pi.infn.it)
Fri, 13 Dec 1996 17:39:55 +0100

To subscribers of the xforms list from Stefano Mancini <mancini@galileo.pi.infn.it> :

Peter Reich wrote:
>
> To subscribers of the xforms list from Peter.Reich@FernUni-Hagen.de (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
> xforms-request@bob.usuf2.usuhs.mil or see
> http://bob.usuf2.usuhs.mil/mailserv/xforms.html

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.

SM

----------------------------------------------------------------------
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
E_Mail: mancini@galileo.pi.infn.it
----------------------------------------------------------------------
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html