PDA

View Full Version : Image effect with QPainter



igorosberg
15th August 2011, 21:17
Hi,

I need to do a transition effect for images. the transition should be as follows:

a small circle is drawn at the center of the first image. then this circle is expanded and within the circle will be drawn the second image. when the circle takes all screen, the transition ends and only the second image appears on the screen.

I know that i should use QPainter::CompositionMode but i dont know how use it to reaches this effect.

These three images help to understand the expected effect:
Image1: http://postimage.org/image/2lvsk56ck/
Image2: http://postimage.org/image/2lw7fzask/
Transition1: http://postimage.org/image/2lwcelc9w/
Transition2: http://postimage.org/image/2lwkoa2qs/

Thanks

high_flyer
17th August 2011, 15:32
The effects Qt offers are not content related - that is, the content (in this case a circle) is nothing Qt can relate to.
The effects are done on a whole image.
So the expansion of the circle is something you will have to implement your self (but that is easy).
If you combine that with alpha blending you can reach the effect you want.