[Qt-interest] Inverting a QPainterPath
Josiah Bryan
jbryan at productiveconcepts.com
Wed Oct 7 16:56:22 CEST 2009
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
More information about the Qt-interest-old
mailing list