PDA

View Full Version : Skew bitmap to QPolygonF



kiozen
1st April 2016, 15:14
Hi,

I just want to make sure I do not overlook something in the documentation. I have a QPolygonF that defines a non-rectangular shape and would like to fit a QImage or QPixmap into that shape by moving the pixels. I would expect such a functionality in QPainterPath or QGraphicsSceen but couldn't find anything. Am I too stupid to read the documentation? Or is it simply missing and I have to code that stuff on my own?

Thanks

Oliver

d_stranz
1st April 2016, 17:29
I have to code that stuff on my own?

You have an ill-defined problem, if your QPolygonF can be arbitrarily complex. Images are in general rectangular. You can apply an arbitrary QTransform to a QImage (see QImage::transformed()), but this is only for 4-sided to 4-sided transformations.

Otherwise, you may find what you need in non-Qt libraries, like OpenGL or OpenCV.