Check if push button has an image on it or not

조회 수: 1 (최근 30일)
Hao Wei Low
Hao Wei Low 2015년 4월 23일
댓글: Hao Wei Low 2015년 4월 23일
I have a bunch of push button where the user can put pictures on but how do I check if the push button has an image on it or not? Below is the code I thought would work but wouldn't. Any help is greatly appreciated.
if (handles.pushbutton1,'cdata',[]) || (handles.pushbutton2,'cdata',[])
msgbox('There are still empty tiles')
end

채택된 답변

Michael Haderlein
Michael Haderlein 2015년 4월 23일
You need to use get and isequal:
if isequal(get(handles.pushbutton1,'cdata'),[]) || isequal(get(handles.pushbutton2,'cdata'),[])
%...
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by