I'm having problems when adjusting the size of the gui when the code is running. The image preview stretches relatively with the preview window, which I don't wan't it to do.
On the guide there's code which should fix the problem:
figSize = get(hFig,'Position');
figWidth = figSize(3);
figHeight = figSize(4);
gca.unit = 'pixels';
gca.position = [ ((figWidth - imWidth)/2)...
((figHeight - imHeight)/2)...
imWidth imHeight ];
But it does not seem to do anything on my Matlab R2013a. There is no difference if I comment or not this part of the code. I also tried the full example code on Matlab R2015a with the same results. The gca part doesn't seem to do anything.
Is there something missing? I'm able to do uipanels in the preview window with fixed positions and resolutions:
video_window = uipanel('Title','video','FontSize',10,...
'Position',[1 1 640 480]);
But how could I then force the preview image to this panel? Buttons can be forced by specifying them with " 'parent', video_window, " initialising commands.
Any help with this matter is appreciated. Thank you in advance.