Qt Snippet: Create QPixmap with transparent background


If you want to create a QPixamp object with transparent background you simply need to fill the entire area with transparent color immediately after created. After doing this you can start to draw over.



QPixmap MyPixmap(QSize(32,32));

MyPixmap.fill(Qt::transparent);

// Now you can draw into
// .......

If you want to know how to draw into a QPixmap check this post.

0 Comments:

Post a Comment