Matlab app designer, overlaying images with transparency in UIAxes?
조회 수: 6 (최근 30일)
이전 댓글 표시
Question ---------
I am trying to display 2 overlaid images in an app within a UIAxes. I know about
imshowpair(bg,fg,'blend');
, and although it does work, it doesn`t allow me to control the transparency level.
f1=imshow(fig1);
f2=imshow(fig2);
and then
set(f2,'AlphaData',alpha);
, but it doesn't work properly within a UIAxes. When I set the 'AlphaData' property, both images become transparent.
Any ideas on how can I do this? The idea would be to have a slider where the user can set the transparency of the top image interactively.
Reference code and images ----------------
f1=imshow(ref,'Parent',app.UIAxes);
hold on
f2=imshow(gbT2,'Parent',app.UIAxes);
hold off
set(f2,'AlphaData', alpha);
댓글 수: 0
답변 (1개)
Chris Portal
2018년 9월 2일
Using R2018a, I'm not able to reproduce this. This is the code I tried:
I = imread('cameraman.tif');
f1 = imshow(I,'Parent',app.UIAxes);
hold(app.UIAxes, 'on')
I2 = imread('pout.tif');
f2 = imshow(I2,'Parent',app.UIAxes);
hold(app.UIAxes, 'off')
set(f2,'AlphaData', 0.5);
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!