Axes handles

Is it possible to access an image that has been assigned to an axes handle on a GUI. I usually use read an image and preassign it using setappdata and then retrieve it using getappdata later. It occured to me that the handles structure must be holding the image somewhere so can I just access this instead?
an example being if I want to rotate an image after it has loaded into the axes component
Thanks Jason

回答 (1 件)

Robert Cumming
Robert Cumming 2011 年 8 月 4 日

0 投票

The image will be a child of the axes, so you can get it through the children field of the axes handle.

8 件のコメント

Walter Roberson
Walter Roberson 2011 年 8 月 4 日
e.g., findobj(TheAxesHandle,'type','image')
Robert Cumming
Robert Cumming 2011 年 8 月 4 日
exactly
Patrick Kalita
Patrick Kalita 2011 年 8 月 4 日
If performance is a concern, using appdata is probably better than using findobj.
Jan
Jan 2011 年 8 月 4 日
@Patrick: FINDOBJ can be very slow, if a large number of handles and their children is searched. If you search just a single child of an axes with known handle, FINDOBJ is as fast as getting the application data for the figure handle.
Walter Roberson
Walter Roberson 2011 年 8 月 4 日
findobj() has the advantage of not relying upon the image being a _direct_ child of the axes -- e.g., it might be a child of a hgtransform .
Jason
Jason 2011 年 8 月 5 日
could someone give me an example please of using FindObj?
Thanks
Walter Roberson
Walter Roberson 2011 年 8 月 5 日
Already did, in the first comment. Repeating it: findobj(TheAxesHandle,'type','image')
Jason
Jason 2011 年 8 月 5 日
Thankyou.

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

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

質問済み:

2011 年 8 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by