[Interest] Force QPainter color draw for SVG files?

Jason H scorp1us at yahoo.com
Tue Apr 17 15:19:03 CEST 2012


Really, what you should do it what he describes, but render it to a PNG/Pixmap, and store that. 



________________________________
 From: "wargand at gmx.de" <wargand at gmx.de>
To: jaume dominguez faus <jaume at land.aau.dk> 
Cc: Qt Interest <interest at qt-project.org> 
Sent: Sunday, April 15, 2012 6:57 PM
Subject: Re: [Interest] Force QPainter color draw for SVG files?
 

SVG is xml. Just load it into a QDomDocument and change the colour. 
If the SVG does not change too much, you could even do a search and
replace of the color values. There are many ways to achieve what you
want, forcing the QPainter to use a certain colour when rendering a SVG
image... I am not so sure about that.

Btw... SVG isn't the most resource friendly format. 

Guido


On Sun, Apr 15, 2012 at 02:45:37PM +0200, jaume dominguez faus wrote:

> Hi list.
>
> I guess the answer is "No". But maybe.... is it possible to force
> QPainter to paint only in, say "red", when I'm rendering a SVG
> that is black?  Imagine that you have a set of symbols in SVG
> files similar to a font characters, and you want to paint them in
> different colors when they are selected. Is it possible to do it
> without making the "selected version" of each SVG file?
>
> Thanks.
> ____________________________________________________________________
> Interest mailing list Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120417/c877094e/attachment.html>


More information about the Interest mailing list