April 12, 201510 yr Trying to get the canvas bounds here, x and y are always 0.Any way to find the real position (Edit: gives the bounds of the canvas on the client ,not on the screen, looking for a way to get a box around the client or just the windows) Edited April 12, 201510 yr by Isolate
April 12, 201510 yr Please show your code so it can be identified easier, more preferrably, a MCVE Edited April 12, 201510 yr by fixthissite
April 12, 201510 yr Author Please show your code so it can be identified easier, more preferrably, a MCVE bot.getCanvas().getBounds(); only returns the rectnagle of the canvas position within the client, so it returns 0,0,width,height. So when using robot to take a screenshot it does it from the 0,0 of your screen.
April 12, 201510 yr bot.getCanvas().getBounds();only returns the rectnagle of the canvas position within the client, so it returns0,0,width,height. So when using robot to take a screenshot it does it from the 0,0 of your screen. You want getLocationOnScreen(). getBounds() returns the locatiom of the component relative to it's container, not your screen Edited April 12, 201510 yr by fixthissite
April 12, 201510 yr Author You want getLocationOnScreen(). getBounds() returns the locatiom of the component relative to it's container, not your screen
Create an account or sign in to comment