Update image representation and renderer

Hi all,
is there any way to update an image so MATLAB doesn't give the control back until those changes are represented in the screen by the renderer?
I know if I run:
tic
drawnow
toc
the drawnow function sends the renderer an update, but it returns the control when the renderer accepts the update, not when it has represented them.
Thanks in advance

답변 (2개)

Image Analyst
Image Analyst 2017년 10월 25일

0 개 추천

Try
% Change mouse pointer (cursor) to an hourglass.
% QUIRK: use 'watch' and you'll actually get an hourglass not a watch.
set(gcf,'Pointer','watch');
drawnow; % Cursor won't change right away unless you do this.
When you want user to interact with the GUI again:
% Change mouse pointer (cursor) to an arrow.
set(gcf,'Pointer','arrow');
drawnow; % Cursor won't change right away unless you do this.

댓글 수: 3

Lask
Lask 2017년 10월 26일
Sorry but I cannot see how could this help to answer my question. I just want to track the exact moment when the screen refreshes and shows a new frame.
Image Analyst
Image Analyst 2017년 10월 26일
It basically takes control away from the user (or so the user thinks) and doesn't return control until you tell it to. But if that's not what you want, see Walter's response.
Walter Roberson
Walter Roberson 2017년 10월 26일
There is a blog entry that says that control is returned from drawnow() when the renderer portion has accepted the update request; that is not something the user can change to not return control until the frame update.

댓글을 달려면 로그인하십시오.

Walter Roberson
Walter Roberson 2017년 10월 26일

0 개 추천

There is pretty much no point in trying to do this without using the free thrid-party PsychToolbox, which has been carefully designed to provide timings relative to the vertical refresh of when an image gets painted.

카테고리

질문:

2017년 10월 24일

댓글:

2017년 10월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by