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

9 views (last 30 days)
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{:});

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 May 2012
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.

More Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Products


Release

R14SP1

Community Treasure Hunt

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

Start Hunting!