Borrar filtros
Borrar filtros

getframe pixel dimensions do not match figure position

5 visualizaciones (últimos 30 días)
Doug
Doug el 29 de En. de 2022
When I use getframe.m, I expect it to produce an image that exactly matches what I see on screen. But getframe produces an image whose pixel dimensions do not match the size of the figure -- if the figure is on the built-in display of my laptop. If I move the figure to the external display (connected to my laptop), getframe produces an imge whose pixel dimensions do match the size of the figure. I'm running Matlab R2020b on MacOS 11.6.
How can I make getframe work as expected on my built-in display?
Example code:
>> figure; image
>> get(gcf,'position') % on built-in display
ans =
677 160 560 420
>> snap = getframe(gcf); size(snap.cdata) % does not match!
ans =
840 1120 3
>> get(gcf,'position') % on external display
ans =
789 1074 560 420
>> snap = getframe(gcf); size(snap.cdata) % does match
ans =
420 560 3

Respuestas (0)

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by