Thanks for this. I was just getting ready to do something very similar. 

On Friday, February 23, 2018 at 2:38:17 AM UTC-5, Friedrich wrote:
>
> as it turns out, i really was close. instead of taking the points from the 
> state, the handle postions needed to be mapped to parent. i adjusted the 
> MWE for those who are interested:
>
> import pyqtgraph as pg
>
> def roiMove():
>    """Print the coordinates of the ROI."""
>    pts = roi.getSceneHandlePositions()
>    print([roi.mapSceneToParent(pt[1]) for pt in pts])
>
> win = pg.GraphicsWindow()
> vb = win.addViewBox()
> # roi in triangle shape
> roi = pg.PolyLineROI([[1, 2], [1.5, 2], [1, 0]],
>            closed=True,
>            pen=pg.mkPen(color=(0, 201, 255, 255), width=3)
>                )
>
> # connect to printing function when moving something
> roi.sigRegionChanged.connect(roiMove)
> vb.addItem(roi)
> vb.setXRange(-5, 5)
> vb.setYRange(-5, 5)
> pg.QtGui.QApplication.exec_()
> Code hier eingeben...
>
>
>

-- 
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 pyqtgraph+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/594d2b24-0362-4b27-b425-48aa684a4ee3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to