Hi,
I'm using imwrite to save images on a machine that I'm accessing via remote desktop. This works as expected when the remote desktop screen is maximised. However, if I minimise or close the remote desktop to get on with something else while it's processing, I just end up with blank images.
This is the code I'm using:
def_back = get(gcf,'Color');
set(gcf,'Color',[1 1 1]);
drawnow
frame = getframe(gcf);
image = (frame2im(frame));
imwrite(image,[<FILENAME> '.png'])
set(gcf,'Color',def_back);
drawnow

 채택된 답변

Jan
Jan 2021년 3월 24일
편집: Jan 2021년 3월 24일

0 개 추천

The observation is correct. getframe does not work outside the visible area of the screen. So this is not a problem of imwrite. Try to replace getframe by:
cdata = print(gcf, '-RGBImage')

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품

릴리스

R2014b

질문:

dan
2021년 3월 24일

댓글:

dan
2021년 3월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by