[Qt-interest] Inverting a QPainterPath

Jason H scorp1us at yahoo.com
Wed Oct 7 17:30:38 CEST 2009


Also see "Composing a QPainterPath" in the docs, which might work, provided you realize you can fill transparent


----- Original Message ----
From: Josiah Bryan <jbryan at productiveconcepts.com>
To: Qt Interest <qt-interest at trolltech.com>
Sent: Wed, October 7, 2009 10:56:22 AM
Subject: [Qt-interest] Inverting a QPainterPath

Is there a way to "invert" a QPainterPath?

Here's what I want to do:

-Create QPainterPath
-Add Text to it (say, "Foobar")
-"Invert" the path so I can use it as a clipping path for a QPainter
-Fill QPainter with some Image
-Now only the pixels of the image OUTSIDE the letters "Foobar" are 
painted. (e.g. the background already existing "shows thru" the letters 
"foobar".)

In reading the QPainterPath documentation at 
(http://doc.trolltech.com/4.5/qpainterpath.html), I dont see a way to 
"turn inside out" or "invert" the QPainter path. For example, in GIMP, 
you can create a selection (or path from text) then "invert" it so 
everything but the original path is selected. Is that dooable with a 
QPainterPath?

Thanks for your time!

-josiah

-- 

-=-=-=-=-=-=-=-=-=-=-=-=-
Josiah Bryan
Productive Concepts, Inc.
jbryan at pciint.com
(765) 964-6009, ext. 224

_______________________________________________
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