Why do I receive the error when using GETFRAME on a figure in a second (dual) monitor?

2 次查看(过去 30 天)
I have performed the following to utilize a dual monitor setup for my workstation and executed GETFRAME to capture an image on the extra monitor:
1. Connect a second monitor as a left-hand extension of the main screen
2. Execute the GETFRAME function
3. Move figure to left (secondary) screen
4. Execute GETFRAME again
When I proceed with the mentioned steps I receive the following error:
??? Error using ==> capturescreen
The rectangle passed to getframe must be at least partially on screen.
Error in ==> getframe at 35
x=capturescreen(varargin{:});

采纳的回答

MathWorks Support Team
There are two possible reasons for receiving this error message:
1. The figure you want to capture via 'getframe' has been moved to the border of your monitor, so that you can see no content at all.
or
2. You are using dualview (dual monitors) and put the figure on the second screen, which cannot be captured via 'capturescreen'.
In both cases the workaround is to move the figure, so that you can see its content on the (first) screen. You don't have to do this manually, you can use the command:
movegui(h)
which automatically moves the figure identified by the handle h to the 'onscreen' position.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

产品


版本

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by