[Qt-interest] render svg into QImage
William Tambellini
William.Tambellini at galaxysemi.com
Tue Jan 18 15:51:41 CET 2011
Happy New Year to all,
I am rendering a svg file into a QImage.
Here is the kind of code I have tried :
QSvgRenderer svgr(QString("f.svg"));
QImage i(svgr.defaultSize(), QImage::Format_RGB16 ); // I have tried nearly
all formats, QImage::Format_RGB32, QImage::Format_Indexed8,.. Without result
QPainter p(&i);
p.setRenderHint(QPainter::Antialiasing, false);
// I have tried too to turn off SmoothPixmapTransform,
HighQualityAntialiasing, NonCosmeticDefaultPen with out result
svgr.render(&p); // when testing the image
pixels, there are already a lot of different colors whereas there should be
only 2 because my svg has only 1 red circle on black backgroung.
i.save("main.bmp"); // I have tried to change quality
to 100 with no result..
Despite lot of trials playing with nearly all the options of Renderer, Image
and Painter, the image is STILL antialiased whereas I want a raw NON
antialiased image.
I tested the QPaintEngine behind and it is the "Raster" one.
- Cant this engine draw image WITHOUT antialliasing feature ?
- Is it a bug ?
Regards,
WT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110118/23eadecd/attachment.html
More information about the Qt-interest-old
mailing list