getting latest image data in imageview

24 views
Skip to first unread message

mohammad sarvi

unread,
Aug 11, 2018, 10:03:51 AM8/11/18
to pyqtgraph
I need to have a latest image data that displaying  in imageview , would you mind please helping me. thanks

Patrick

unread,
Aug 12, 2018, 11:40:42 PM8/12/18
to pyqtgraph
You can get the ImageItem component from the ImageView, and then the image data from the ImageItem using:

image = imageview.getImageItem().image

Not that the value can be None if the image hasn't been set yet.

(By the way, the trick to finding this is looking at the source code, by clicking the green [source] link in the API documentation: http://www.pyqtgraph.org/documentation/_modules/pyqtgraph/graphicsItems/ImageItem.html#ImageItem)

mohammad sarvi

unread,
Aug 13, 2018, 5:54:33 AM8/13/18
to pyqtgraph


در دوشنبه 13 اوت 2018، ساعت 8:10:42 (UTC+4:30)، Patrick نوشته:
 Thanks for your Attention But i use viewBox inside a graphicsView and i want the image that displaying inside 

Patrick

unread,
Aug 13, 2018, 8:41:10 PM8/13/18
to pyqtgraph
Do you mean save an image file of the contents of the current plot window? In that case there are exporters which can do that. See http://www.pyqtgraph.org/documentation/exporting.html#exporting-from-the-api

(Otherwise, a ViewBox alone doesn't display an image, you must have added a ImageItem or similar to the ViewBox to actually store and display image data.)
Reply all
Reply to author
Forward
0 new messages