1 #include <QtGui/QImage>
2 #include <QtCore/QString>
4 #include <ksvgrenderer.h>
5 #include <QtGui/QPainter>
11 int main(int argc
, char **argv
)
15 cout
<< "Usage : ksvgtopng width height svgfilename outputfilename" << endl
;
16 cout
<< "Please use full path name for svgfilename" << endl
;
20 int width
= atoi(argv
[1]);
21 int height
= atoi(argv
[2]);
23 QImage
img(width
, height
, QImage::Format_ARGB32_Premultiplied
);
26 KSvgRenderer
renderer(QString::fromLocal8Bit(argv
[3]));
27 if(renderer
.isValid())
32 // Apply icon sharpening
44 *img = KImageEffect::sharpen(*img, factor); // use QImageBlitz::sharpen()
48 img
.save(argv
[4], "PNG");