Adding Background image in GraphicsWindow

58 views
Skip to first unread message

jsudhir...@gmail.com

unread,
Aug 26, 2017, 5:26:46 PM8/26/17
to pyqtgraph

Hi,

I am using PyQtGraph for sometimes now. I am making use of GraphicsWindow for my application. I want to add an image as a background image for the GraphicsWindow. But i could not achieve this.
I tried the following but in vain.

What i tried so far
1)
app = QtGui.QApplication([])
win = pg.GraphicsWindow(title="Sample")
win.resize(1000,600)
win.setWindowTitle('Sample')
pg.setConfigOptions(antialias=True)
proxy = QtGui.QGraphicsProxyWidget()
qwidget = QtGui.QWidget()
qwidget.setStyleSheet("background-image:url(folder1/folder2/image.png);")
proxy.setWidget(qwidget)
p3 = win.addLayout()
p3.addItem(proxy)

2)
app = QtGui.QApplication([])
win = pg.GraphicsWindow(title="Sample")
win.setStyleSheet("background-image: url(folder1/folder2/image.png);") - But this didn't work out. And this didn't throw any error. I would like to modify my application to look like the one attached as "Expected.png".

What is expected? - I ve attached an image in the name "Expected.png"

What is achieved? - I ve attached an image in the name "Achieved.png"

Can somebody help me out here in achieving the application as how it looks in Expected.png?



jsudhir...@gmail.com

unread,
Aug 28, 2017, 2:21:15 AM8/28/17
to pyqtgraph
I could not progress on this. Can some body pls help me here. How to add a background image for pyqtgraph "graphicswindow ". I couldn't add any image
Reply all
Reply to author
Forward
0 new messages