[Qt-interest] paint one image over other continously

Alessandro Portale Alessandro.Portale at trolltech.com
Fri Sep 25 10:53:38 CEST 2009


Two possible solutions:

The first thing you may try is setting the Qt::WA_OpaquePaintEvent 
attribute of the displaying widget
See...
    http://doc.qt.nokia.com/latest/qt.html#WidgetAttribute-enum
...and...
    http://doc.qt.nokia.com/latest/qwidget.html#setAttribute
That will avoid that the widget is cleared between to paint events.

If that does not do the job for you, you may create one offscreen QImage 
with the right size. Each time, data comes from the network, create a 
painter on that image and draw the fresh piece of image on it. Than can 
happen outside the paint event.
In the display widget's paint event, you just draw the whole offscreen 
image to the screen.

Alessandro

Rahulkumar Tibdewal schrieb:
> It's not a question of calling update(). Update will simply invoke paint event again. I want my previous image should not get overwritten.
> 
> Thanks
> Rahul
> 
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of John McClurkin
> Sent: Thursday, September 24, 2009 8:45 PM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] paint one image over other continously
> 
> Rahulkumar Tibdewal wrote:
>> Hello All,
>>
>>  
>>
>> I am developing the application where server can monitor the client 
>> desktop. I am sending the images continuously from client to server so 
>> that server can see client desktop.
>>
>> Images are sent whenever there is any change on client desktop. i.e. 
>> only changing rectangle images are sent for performance reasons.
>>
>>  
>>
>> My Question is how can I paint continuously appearing images from client.
>>
>> I want to paint one image over other to its proper location continuously 
>> so that it appear and continuous visualization of desktop, I am not sure 
>> how's that possible.
>>
> By calling update() on the server widget that displays the client 
> desktop whenever a new image is received? Really, this question is too 
> vague to allow people to help you.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list