Hy everybody,

I try to make a customButton with alpha image.
The objectif is to change color of icon from alpha.

I have a code works but I have two probleme...
    - My picture does not have antialiazing, but my painter have flage.
    - It's impossible to scale image.

The code :
def paintEvent(self, qt_event):

        qt_painter = QtGui.QPainter(self)
        
        qt_color = QtGui.QColor(100, 200, 100, 255)
        qt_region = QtGui.QRegion(self._qt_pixmap.mask())

        qt_painter.setClipRegion(qt_region)
        qt_painter.setRenderHint(QtGui.QPainter.Antialiasing)
        
qt_painter.setRenderHint(QtGui.QPainter.RenderHint.HighQualityAntialiasing)
        
        qt_painter.fillRect(self.rect(), qt_color)

        qt_painter.end()

My picture has a size 30px.
My widget has a size 90px.
If I set custom rect in "fillRect" nothing change... draw always have 30px 

Anyone have a solution ?

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/d91d5a93-5459-40ec-9efd-9974f1809f1a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to