Circular image area
-
Hi,
I put images in my program with the help of Pillow.
I display the image as aQPixmap
inside aQLabel
, using thesetPixmap()
method.The images I display have a circular shape.
What I want is the images to have a circluar area(?) instead of a rectangular one, so that if I put 2 images next to each other the corner of one image will not obscure the other one.I can`t seem to find a solution for this, I did found a simple solution in C#, here.
Thanks.
-
Hi,
I put images in my program with the help of Pillow.
I display the image as aQPixmap
inside aQLabel
, using thesetPixmap()
method.The images I display have a circular shape.
What I want is the images to have a circluar area(?) instead of a rectangular one, so that if I put 2 images next to each other the corner of one image will not obscure the other one.I can`t seem to find a solution for this, I did found a simple solution in C#, here.
Thanks.
@tovikonioput
they should be, when the images contain transparency. Is that not the case?you may also want to try one of those calls (on the labels):
setAttribute( Qt::WA_TranslucentBackground, true ); setAttribute( Qt::WA_OpaquePaintEvent, false); setAutoFillBackground(false);
-
@tovikonioput
they should be, when the images contain transparency. Is that not the case?you may also want to try one of those calls (on the labels):
setAttribute( Qt::WA_TranslucentBackground, true ); setAttribute( Qt::WA_OpaquePaintEvent, false); setAutoFillBackground(false);
@raven-worx the images do not contain transparency, how can I add it to them?
-
@raven-worx the images do not contain transparency, how can I add it to them?
Hi! You need to reimplement the
paintEvent
ofQLabel
class to have circular image.