[Qt-interest] QImage fade

Mihail Naydenov mlists at ymail.com
Sat May 7 17:32:03 CEST 2011





----- Original Message ----
> From: Sean Harmer <sean.harmer at maps-technology.com>
> To: qt-interest at qt.nokia.com
> Sent: Sat, May 7, 2011 6:08:59 PM
> Subject: Re: [Qt-interest] QImage fade
> 
> Hi,
> 
> On Saturday 07 May 2011 07:33:41 Joshua Grauman wrote:
> >  Mihail,
> > 
> > Thanks for the suggestion. I've tried multiple times to  do this directly
> > with QPainter and as far as I can tell it isn't  possible directly (at
> > least not without extra deep copies of the entire  QImage). If someone has
> > a direct way to do this with QPainter, I'd love  to see it! Thanks.
> 
> Are you trying to display the fading image in  real-time? If so, then I would 
> suggest that you use OpenGL. Just draw 2  textured triangles for each image 
> such that they form a  rectangle.
> 
> Draw one image, then overlay the second image over it with a  suitable blend 
> function, glBlendFunction(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA)  say. 
> 
> Then each frame vary the alpha of the second image from 0 up to  1.
> 
> Google around for "OpenGL fade" and you'll find plenty of resources to  help 
> you do this plus other related things like fading in/out to black  etc.
> 

I think these are all possible with QPainter, considering it supports blending 
modes already, 

and is also highly likely, under openGL backend, to use internally the method 
you outlined.

MihailNaydenov 

> HTH,
> 
> Sean
> 
> _______________________________________________
> Qt-interest  mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
> 



More information about the Qt-interest-old mailing list