PDA

View Full Version : How to Optimized Combined Graphical Operations?



sunny.cpp
28th April 2010, 11:02
Hi,

Here is a Scenario, A series of operations that I will call for painting,

QPainter p(this);

1). p.fillRect(0,0,320,240, RED_COLOR)

2) p.drawLine(0,0,100,100, BLUE_COLOR)

3) p.fillRect(0,0,320,240, YELLOW_COLOR)

Now I want that painter should not draw first FillRect Function. It should not draw line. It should only perform last operation.

Is there any way to achive this optimization in Qt.

Is this type of drawing/painting optimizations are supported by any library?

aamer4yu
28th April 2010, 12:06
Now I want that painter should not draw first FillRect Function. It should not draw line. It should only perform last operation.
On what conditions do you want that to happen ? If you have some condition, put those condition before painting..
If you dont have any such condition, then you can delete the fillRect and drawLine statements