inserting a picture with no background in GUI

조회 수: 1 (최근 30일)
Kamuran
Kamuran 2016년 1월 3일
댓글: kyana shayan 2016년 1월 11일
Hello, I am trying to insert an image in to my GUI. I created axes and imshow and when I run the GUI I can see the image. My problem is my image has no background (i don't want it to have a background) and when the code runs I get all black background and the image. Any ideas why GUI does that and how I can prevent it from happening?
I attached the image if that helps.
Thank you
  댓글 수: 1
Jan
Jan 2016년 1월 3일
Please explain, if the image is indexed or in true color.

댓글을 달려면 로그인하십시오.

답변 (2개)

Jan
Jan 2016년 1월 3일
If the image is an indexed imaged with a colormap, set the pixels of the image's background color to the background color of your GUI.
  댓글 수: 1
Kamuran
Kamuran 2016년 1월 3일
First, I dont know what is indexed imaged with a colormap but even it is not. Why Matlab does what it does and insert a black background to my GUI?

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2016년 1월 3일
You didn't attach the image. An image must be rectangular. If MATLAB can take PNG files (which can have transparent pixels) and show you the figure background underneath the axes, then I don't know how to do that. Do you know for certain that you have transparent pixels and a PNG image? If you don't then there must be something in all areas of the image, so if not black, then what should it be? How are you displaying the image?
  댓글 수: 8
Image Analyst
Image Analyst 2016년 1월 11일
I'm not familiar with how or if transparent pixels work with PNG images, like if you can put an axes with a PNG image in it that has transparent pixels over another axes with a regular RGB image in it and have the underlying RGB pixels show through the transparent regions.
You could make a mask and then assign the non-transparent pixels to the RGB image to create a new RGB image with the images combined. Would that work for you?
kyana shayan
kyana shayan 2016년 1월 11일
I don't know how to do that? can you be more specific?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Red에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by