Object IO, fast window redraw

Peter Achten peter88@cs.kun.nl
Mon, 22 May 2000 17:23:04 -0700


Dear Valery,

At 19:11 22-5-00 +0400, you wrote:
>Hello clean-list and clean-guru,
>
>my questions about fast window redraw in Object IO.
>
>By now pixel-wise drawing (drawPointAt) is tooo slow. I think twice
>before resizing my window or before restoring it from minimized state.
>
>Q1: is there a good advice?
>
>[Of course we can create temporary bitmap file and reuse 'draw'
>instanced for bitmap but this is like a crutch]
>Q2: is there someone who has such an optimized code?
>
>thank you in advance.
>
>--
>Best regards,
>  Valery                          mailto:khamenya@module.ru

Much depends on your actual program and what you want to draw. However, two 
rules of thumb are:

* use drawPoint instead of drawPointAt (the latter restores pen position, 
the first advances the pen position one pixel to the right)

* if you draw a number of points in one colour in one row/column it is 
faster to draw a line. Again, drawLine is faster than drawLineAt because 
the latter restores pen position).

* minimise switching pen/back colour

Hope this helps,

Peter