PDA

View Full Version : try to cut QPixmap in any shape



damonlin
5th January 2009, 13:39
I've searched this topic, but I can't find anything.....

Is there any way that I can cut out a QPixmap in any shape instead of rectangle ??

I saw the example of "puzzle" of QT4.4, and all I want to do is try to change the shape of the puzzle。

QPixmap copy ( const QRect & rectangle = QRect() ) const
QPixmap copy ( int x, int y, int width, int height ) const

The above two methods don't seem to be proper.

thank you ~~

wysota
5th January 2009, 21:49
You can apply a mask to any pixmap that supports transparency. The pixmap will still be rectangular (as it is a 2D entity) but some parts of it will be transparent.