[Kde-games-devel] SVG rendering (was KSame)

Mauricio Piacentini mauricio at tabuleiro.com
Sun Nov 5 15:47:53 CET 2006


I did test while porting the Tileset.cpp file in KMahjongg with all 
image types. If you need a proper alpha channel (with gradients) you 
should prob use premultiplied, as final compositing will be faster.

I could not use QPixmaps directly for rendering, but I do not remember 
why exactly. Sorry, it was a couple of months ago. I *think* it might 
have to do with the need to render outside a paintEvent, not sure.

But anyway, if you want to have another look at quick SVG to pixmap 
extraction see Tileset.cpp and Tileset.h in Kmahjongg. I use a XML file 
to store versioning information (and possibly support PNG in the future, 
not sure yet.) For converting the SVG to pixmap elemements I am using 
KSVGRenderer for svgz support and named elements in the SVG file. Art 
was created with Inkscape.

Regards,
Mauricio Piacentini

>> For QImage, I was not sure whether to use ARGB32 or
>> ARGB32_PreMultiplied. The compat method setAlphaBuffer sets ARGB32
>> (the docs don't say so, but the code does), so I used that.



More information about the kde-games-devel mailing list