[PyQt] Re: rendering svg

Niels Egberts niels.egberts at gmail.com
Thu Apr 17 16:00:33 BST 2008


Thanks for pointing me in the right direction, I got it working with this
code:

        self.grid = QtGui.QImage()
        self.grid.load("/home/niels/Programmeer/arimaa/images/grid.svg")
        target = QtCore.QRectF(0.0, 0.0, self.width(), self.height())
        paint.drawImage(target,self.grid)

Thank you very much

On Thu, Apr 17, 2008 at 4:31 PM, Phil Thompson <phil at riverbankcomputing.com>
wrote:

> On Thursday 17 April 2008, Niels Egberts wrote:
> > Now I have found this:
> >
> > self.picture = QtGui.QPicture()
> > self.picture.load("/home/user/grid.jpg")
> >
> > And it gives the error:
> >
> > QPicturePaintEngine::checkFormat: Incorrect header
> >
> > I have tried with a jpg, bmp, svg and an png but all of them return an
> > "incorrect header". What am I doing wrong?
>
> Completely misunderstanding what the QPicture class is for. You want
> either
> QImage or QPixmap.
>
> Phil
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080417/22067db3/attachment.html


More information about the PyQt mailing list