GUI: how to insert png image with original resolution and transparent background?
2 ビュー (過去 30 日間)
古いコメントを表示
I found that inserting images is done by the axes object. I can show the image (16x16 pixels) in my GUI, but it's always magnified, and the transparent background is rendered black. How can I fix this?
Thanks!
0 件のコメント
回答 (1 件)
Arturo Moncada-Torres
2011 年 8 月 31 日
To keep your image in its original scale, you have include the following line just after the one where you display the image in the axes (with image, imagesc or imshow):
axis image;
Regarding the transparent background, I suggest you to take a look at this MATLAB Newsgroup thread. I think your question is answered here.
2 件のコメント
Arturo Moncada-Torres
2011 年 9 月 1 日
Yes, your solution for keeping the image in its original scale would work, but it is not practical (suppose you change of image, you would have to do it again!).
Suppose you have the axes' handle in a variable called h. Try it this way:
axis(h, 'image')
Regarding the alpha channel issue, I am glad it worked ;-)
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!