Removing white axes border around image GUI
9 次查看(过去 30 天)
显示 更早的评论
I Have a problem when coding my GUI i read an image file after pressing the LOAD button and try to insert the image into the axes but cant get rid of the white border around it, any suggestions?
回答(1 个)
Vinayak Choyyan
2023-4-12
Hi Mikolaj,
As per my understanding, you are using ‘uiimage’ of MATLAB App Designer and facing an issue with a white background when loading new images into the ‘uiimage’.
To resolve the issue you are facing, you can try out any of the following solutions:
- Set the ‘BackgroundColor’ property of ‘uiimage’ to ‘none’. To know more about ‘BackgroundColor’ property, please refer to this documentation page https://www.mathworks.com/help/matlab/ref/matlab.ui.control.image-properties.html#mw_03d5d287-464f-41e1-91de-cf8db63135c7. You can also change the background color to match the app background color.
- By default, the ‘ScaleMethod’ property of ‘uiimage’ is set to ‘fit’. Change this property to hide the background color as per your use case. To know more about ‘ScaleMethod’ property, please refer to this documentation page https://www.mathworks.com/help/matlab/ref/matlab.ui.control.image-properties.html#mw_f8a05f7c-9b7a-45c0-87dc-cc44b6c16b36_sep_mw_987a59d0-ad6c-4838-b9bc-afa9465b666e
- Adjust the ‘Position’ property of ‘uiimage’ to match the image’s size. To know more about ‘Position’ property, please refer to this documentation page https://www.mathworks.com/help/matlab/ref/matlab.ui.control.image-properties.html#mw_93260cd1-c3dd-40a8-942d-41a75a301966
I hope this resolves the issue you are facing.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!