next up previous contents index
Next: A.39 Why doesn't the Up: A Frequently Asked Questions Previous: A.37 How can I

A.38 Why are there black pixels left in the drawing area?

     

If you find the pixels droppings disturbing, do a refresh (<Ctrl+V>). If you are not interested in technical details, skip the rest of this question.

TCM draws in exclusive or (XOR) mode. In XOR mode, the new destination pixel is produced by the exclusive or of the old destination pixel with the source pixel. In this mode, you can easily draw and erase a figure. You draw a figure to let it appear, and when you redraw it, you erase it. By sequencing drawing and redrawing you can simulating a shape being moved or dragged. Furthermore, in XOR mode, shapes can overlap each other without damaging each other. The overlapping part is then white, and when one of the shapes is moved or removed, it will be redrawn, so that the overlapping part will appear black again. For some unknown reason, there is sometimes a small rounding error in drawing certain shapes that makes that some black pixels remain.

A feature of TCM is that it maintains a second pixmap in the background which contains a copy of the contents of the drawing area. It is used to copy back the contents into the drawing area quickly when the drawing area has been overlapped by other windows, resized etc. Although this solution consumes a lot of memory, it makes drawing graphics relatively fast. A drawback is that pixel droppings may occur with some types of shapes, for instance on the corners of rectangles because they are copied, not xor-ed.


next up previous contents index
Next: A.39 Why doesn't the Up: A Frequently Asked Questions Previous: A.37 How can I
Frank Dehne,Faculty of Mathematics and Computer Science, Vrije Universiteit Amsterdam
11/17/1997