So currently I have a pushbutton that can change to a specific picture via a popup menu. I also have a resizeable figure with resizeable pushbuttons.
However, the image itself does not change size, only the frame that it is in. How do I make the image itself fit the frame so that it is not cropped? I don't mind stretching or resolution right now, I just want to be able to see the entire image.
What I've done so far is use HTML and string concatenation to call an image as part of the string of a uicontrol:
hS1 = '<html><img src="file:///C:/Users/Project626';
hS2 = '" width="20px" " height:"20px" /></html>';
htmlStr = strcat(hS1,S.img,hS2);
S.imagex = uicontrol(S.fig,'units', 'normalized',...
'position',[.01 .83 .12 .16],...
'String',htmlStr,'Background','white',...
'callback',{@imagex_call,S});
with S.img being the name/path of the image stored as a string. Now S.imagex is an image with the callback @imagex_call.
At one point, I had another function change the pixel count for hS2 (and thus the image) based off of the resizing of the figure (using SizeChangedFcn). However, changing the width and height does absolutely nothing to my image, not even if I use percents instead of pixels.
If anyone who actually knows HTML (because I don't) can explain what I'm missing here, that would be very helpful.