
how to position and resize an image mask on my System Composer "component" block
조회 수: 8 (최근 30일)
이전 댓글 표시
When I insert an image mask over my System Composer component block, the image obscures the block title and port names. I have not found a way to adjust the position and size of the image mask to avoid this. Search results give the image() command: https://www.mathworks.com/help/simulink/slref/image.html but this is for Simulink blocks, not System Composer component blocks.
I also got setMaskImage command here which is specifically for System Composer component blocks: https://www.mathworks.com/help/systemcomposer/ref/systemcomposer.arch.architecture.setmaskimage.html but it does not list adjusting position and size of the mask image.
How would I go about adjusting the System Composer component mask image to improve the look and not obscure other important block name and port names?
댓글 수: 0
채택된 답변
Josh Kahn
2025년 2월 28일
If you put this file into your userpath and restart matlab, it will add a right-click option to change the IconTransparency setting on components that you have masked. This is a work-around but I have also submitted an enhancement request to make this accessible via the GUI.

You can find your userpath by typing:
>>userpath
If you already have a file called sl_customizations in there, please send me a message because we will have to merge them
Josh
댓글 수: 8
Josh Kahn
2025년 3월 14일
Hi Frank,
I double-checked and this is a bug in R2024b Update 5 that is fixed in the next update.
Josh
추가 답변 (1개)
Epsilon
2025년 2월 26일
편집: Epsilon
2025년 2월 26일
Hi Frank,
When setting the mask image for System Composer component block using ‘setMaskImage’ function, use ‘IconTransparency’ input argument and set it to ‘opaque-with-ports’ to ensure that the image does not obscure the port and block name.
Syntax:
comp.Architecture.setMaskImage(FilePath="Filepath", IconTransparency="opaque-with-ports");
Appearance before and after specifying the Icon Transparency argument:

Hope it helps.
참고 항목
카테고리
Help Center 및 File Exchange에서 Author System Behaviors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!