Image Transparency in AppDesigner
Mostra commenti meno recenti
I am building a GUI in AppDesigner, and in the static layout I have a few images. I have successfully been able to bring the gray image behind the bluer backgrouond, but I have not been able to change the transparency of the "foreground" image to show that the gray is behind it. All the tutorials I have foudn so far have been for changing transparency for image outputs, not static parts of the GUI. I would appreciate any and all help- thank you!

5 Commenti
Yongjian Feng
il 17 Nov 2021
"foreground" image is the most up front image? Is it a png with transparent background?
Maximilian Orman-Kollmar
il 17 Nov 2021
I'm just going to assume you're trying to do this composition strictly via graphics object properties instead of the raster data. Since AppDesigner is completely unusable in my environment, I'm just going to assume that something analagous works:
A = imread('peppers.png');
B = imread('cameraman.tif');
imshow(A); hold on % display BG image
hfg = imshow(B); % display FG image
hfg.AlphaData = 0.5; % set scalar alpha
Note that when you set the alpha of the BG layer, you'll be blending with the figure background.
That said, you're talking about putting the "background" sand image on top of the "foreground" projectile/probe/thing. Is that really what you want? The matting in the foreground image isn't uniform and will remain noticeable regardless of layer ordering. If these images don't need to be programatically rearranged in use, it would be simpler to just throw this in an image manipulation program and make a single image -- or to at least tidy up the FG image to aid in compositing.
Maximilian Orman-Kollmar
il 18 Nov 2021
Yongjian Feng
il 18 Nov 2021
Yes, I was about to suggest the same thing. If you are using uiimage, switch to UIAxes.
Risposte (0)
Categorie
Scopri di più su Images in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

