PDA

View Full Version : Adding gradient of colors



marc2050
3rd August 2011, 01:46
Hi.

I've a square canvas.
I like to draw circles in it.
Each circle is filled with gradient color (e.g. centre is red and becomes more blue as it reaches the edge of the circle. Some may start with green and end as yellow etc.)

My question is, how do I add the colors together when the circles overlap? I like to have a way to "add up" the colors that overlap. Is there a way to do that instead of having to count pixels by pixels the color value and add them (I'm not even sure if this will work)?

Any help? Thanks!

Santosh Reddy
3rd August 2011, 07:21
You can draw the circles with a gradient QBrush, and image composition, Refer this Example for Composition (http://doc.qt.nokia.com/4.7/painting-imagecomposition.html)