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.

Comments

Popular posts from this blog

Access GPIO from Linux user space

Android: adb push and read-only file system error

Tree in SQL database: The Nested Set Model