Found the way to load a QImage into the label on GraphicsLayoutWidget.
Cheers,
Vasilije
import pyqtgraph
app = pyqtgraph.QtGui.QApplication([])
win = pyqtgraph.GraphicsLayoutWidget()
qi = pyqtgraph.QtGui.QImage()
label = pyqtgraph.QtGui.QLabel(win)
qi.load('image.png')
label.setPixmap(pyqtgraph.QtGui.QPixmap.fromImage(qi))
win.show()
if __name__ == '__main__':
import sys
if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
pyqtgraph.QtGui.QApplication.instance().exec_()
On Wed, Jul 19, 2017 at 7:16 PM, Patrick Kreitzberg <[email protected]>
wrote:
> Hi,
>
> I am working with a large-ish data set which I currently graph by loading
> the array into a colormap than loading that array into an imageitem. My
> problem is that once I run the data through a colormap and plot the data
> ~90 seconds has gone by, and the user may want to select between several
> data sets all of the same size. I am hoping to speed that up by reading in
> an image file that I saved using ImageItem.save().
>
> Can anyone show me an example of how to do this?
>
> I can load the image into a QImage using
> qi = QtGui.QImage()
> qi.load('./image.png')
>
> But I am not sure how to get the QImage into a plotwidget or similar
> widget in order to graph the jpg into the QMainWindow.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyqtgraph" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/pyqtgraph/fc7ccf60-eae3-4905-861e-b5239daaab73%40googlegroups.com
> <https://groups.google.com/d/msgid/pyqtgraph/fc7ccf60-eae3-4905-861e-b5239daaab73%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CAD_qyJpTZTrO2GgQucbZjd%2Bi_Vze2RC-RjvB_p9J%2BNeav88yAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.