フィルターのクリア

Logo looks different after uploading

5 ビュー (過去 30 日間)
Franta Cymorek
Franta Cymorek 2017 年 4 月 4 日
コメント済み: Franta Cymorek 2017 年 4 月 4 日
As you can see in the first picture, that is a logo I want to upload to my Matlab GUI. But after uploading it changes - it's rendered with a black color, or I would say it uses a black color as a backround (right down corner).
The code I'm using:
axes(handles.axes13)
imshow('logo4.png')
To fix it I have tried:
axes(handles.axes13)
set(gca,'color','none')
imshow('logo4.png')
But doesn't work. Could you please help me out?

採用された回答

Guillaume
Guillaume 2017 年 4 月 4 日
PNG images can have transparency information embedded in them and yours does. However, you discard it with your imshow call.
axes(handles.axes13)
[cdata, ~, transparency] = imread('logo4.png'); %get transparency
himg = imshow(cdata);
himg.AlphaData = alpha; %apply transparency to the image.
However, note that the background colour will be that of the figure, not the axes since imshow makes the axes not visible.
  1 件のコメント
Franta Cymorek
Franta Cymorek 2017 年 4 月 4 日
I have a different working solution, but still a big thanks for your help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by