フィルターのクリア

Createfcn is not working during displaying an image in background?

1 回表示 (過去 30 日間)
Rafet
Rafet 2014 年 8 月 31 日
編集済み: Image Analyst 2014 年 8 月 31 日
Hi,
I have a simple code to display an image in GUI background, but I cannot make it visible.
I just did the same thing with this video,
What can be the problem?
In addition I realized that matlab is not executing the createfcn callback of axes object.
Thanks in advance
Rafet
  2 件のコメント
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 8 月 31 日
編集済み: Salaheddin Hosseinzadeh 2014 年 8 月 31 日
Hi Rafet,
Put the lines of the code related to displaying the code plz.
You should have something similar to this
plot(handles.axis1,Xdata,Ydata);
CreateFcn executes once, and that's only when the object is created so it won't execute repetitively just because the axis is viewed.
Rafet
Rafet 2014 年 8 月 31 日
thanks for your answer, I did not know that createfcn executes only once
to overcome this problem I put my code under openingfcn
it works

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

回答 (1 件)

Image Analyst
Image Analyst 2014 年 8 月 31 日
編集済み: Image Analyst 2014 年 8 月 31 日
Your best bet is to just ignore all GUIDE CreateFcn() functions. Don't put any code into them. You can put code into the OpeningFcn, which executes once upon startup. Or you can put code into the OutputFcn() which executes once upon startup, after the OpeningFcn has run and after the FUI window has been made visible. OutputFcn also executes when the GUI shuts down. I really suggest you put lines like these into the functions to see when, and in what order, they are run:
fprintf('Now running OpeningFcn....\n'); % or OutputFcn or whatever...
Note, there are some lines of code that must be put into OutputFcn such as those to maximize the GUI window:
FigurejFrame = get(handle(gcf),'JavaFrame');
FigurejFrame.setMaximized(true);
Thanks to Yair for the above code http://undocumentedmatlab.com/

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by