Making pictures transparent before placement on a graphics scene?
-
So I have this problem right and its hard to explain but I am going to give it a shot.
I have a picture of a soccer ball on a white background which I have added to a graphics scene like so:
@ QGraphicsPixmapItem *picture = new QGraphicsPixmapItem(QPixmap("C:/Users/Public/Pictures/images (2)"));
scene.addItem(picture);@
My scenes background has been set to another color.
So what I have is a soccerball on white background inside a rectangular frame on my scene's background.
But that's not what I want
I want just the ball ,which is round, on my scene's background
My question is how do I get rid of the rest of the picture and have just the ball on my scene's background? -
You need a transparent background around the soccer ball in your image, rather than a white background. Unfortunately, jpg files do not support transparency. You can convert the file to a format which supports transparency, such as png. I don't think paint will handle this. There are a number of editors available for Windows, though I don't have a good list myself (I've always used GIMP, myself.) But a quick Google search could point you in the direction of some good apps which can do what you need.