getting the current scale of the ImageItem, or updating the scale of the ImageItem properly

17 views
Skip to first unread message

Denis Vasyukov

unread,
May 3, 2019, 9:45:47 AM5/3/19
to pyqtgraph
I am writing a GUI for scanning probe microscopy.
I am displaying the images in the ImageItems inside GraphicsLayoutWidget, which also has a PlotItem.
To match the axes of the PlotItem to the images I have to scale them, and it works fine, until I need to
change the scale for a new image.
It seems that a consecutive scale command is like applying the scale with the squared X and Y values.
So, I probably have to restore the scale somehow to the original value, but I cannot read out scale. What are my options?

Patrick

unread,
May 4, 2019, 9:39:47 PM5/4/19
to pyqtgraph
Hi,

It's not on the documentation for ImageItem, since it is an indirect descendant of a Qt QGraphicsObject, but all the QGraphicsObject methods also apply to an ImageItem. So you will want to do a img.resetTransform() before applying a new set of scale/translate transforms.

Patrick
Reply all
Reply to author
Forward
0 new messages