Adding fillcolor to ROI - possible?

150 views
Skip to first unread message

Johannes Teiwes

unread,
Jul 26, 2016, 2:29:34 PM7/26/16
to pyqtgraph
Hi,

I am trying to fill a ROI with a preferable transparent color - is there any way i can do it?

unfortunately a ROI does not have a function like

roi.setBrush(some_brush)

So far i didn't find the right method. There is the setPen Method, but it only configure how the edges are drawn. I am not an expert in the Qt-Graphicsview world - i hope there is a widget or any other Qt-object 'behind' the ROI which i can access and set a background color to.. Any help in that direction is greatly appreciated :-)

Vincent Le Saux

unread,
Jul 29, 2016, 5:38:16 PM7/29/16
to pyqtgraph
Hi,

ROI objects inherits from GraphicsObject which also inherits from QGraphicsObject (and all ROI objects in pyqtgraph such as rectangle and polyline for example inherits from ROI). You should be able to overwrite the appropriate class and reimplements the paint method to 'fill' to form. That should work, but there may have cleaner way to solve your problems. Other ideas?

Vincent
Reply all
Reply to author
Forward
0 new messages