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

Launch an app from Android shell terminal

Qt 5 and " Failed to load platform plugin 'windows' " error