Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

I call grabPoint inside a loop. The resulting image window keeps moving? #160

Open
ctross opened this issue Dec 2, 2021 · 3 comments
Open

Comments

@ctross
Copy link

ctross commented Dec 2, 2021

Hey again,

Again, much gratitude for this amazing package.

I use imager in my own package, and I need to grab 4 points off of the same image. I then repeat the process for several images.

There is some weird behavior of the pop-up image window however. The first time the pop-up opens after calling grabPoint, everything is fine. The image opens up centered in the R console. However, for the next three times I need to grab points, the pop-up shows up in random locations. It is really time consuming to have to grab the pop-up window, center it again, then click to grab the point, and then have to repeat this process.

Digging through the code, I follow the grabPoint function, and see that it depends on select() inside the CImg.h file.

I think somewhere in there, it is programmed to move the screen location of each successive interactive window? Is there an option that could be set by imager, so that the window always opens in the same location?

If you could let me know of anyway to make this happen, even if it means I have to build from source, it would be a HUGE help to me!

Thanks in advance!
example

@ShotaOchi
Copy link
Contributor

I skimmed the source code of CImg.
I don't think CImg does something to change location of pop-up image window.
Maybe the window system of OS does it.
Anyway your interest is not the origin of the change of location of pop-up image window.

I agree it's useful if we can specify location of pop-up image window.
We can move pop-up image window to specified location.
I will implement it within next week.

@ctross
Copy link
Author

ctross commented Dec 9, 2021

Fantastic news. Thanks for looking into this, and for adding the location specification. Let me know once you push any changes, and I'll check out the updated version.

Again, much thanks for taking the time to address these feature requests. I am very grateful for the help and for the great software!

@Sade154
Copy link

Sade154 commented Dec 31, 2021

This would be really helpful. On my laptop (windows 10), I can't even see the image to grab (it appears in the windows taskbar but when I click on it, nothing happens and I have to close R.
The command used is: imager::grabRect(imager::boats) (with the latest version of imager, R and Rstudio).
Thank you very much for this very (very very) useful package.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants