メインコンテンツ

imgcf

R2026b

イメージを含む現在の Figure を取得

説明

fig = imgcf は、イメージを含む現在の Figure を返します。Figure は、少なくとも 1 つのイメージを含む正規の Figure ウィンドウ またはイメージ ツールのウィンドウです。

現在開いており、かつイメージを含む Figure がない場合、imgcf は新規の Figure を作成します。

例

例

すべて折りたたむ

イメージ ツールのウィンドウでイメージを開きます。

I = imread("strawberries.jpg");
imtool(I)

Figure Image Tool 1 - I contains an axes object and other objects of type uimenu, uitoolbar, uipanel. The hidden axes object contains an object of type image.

イメージ ツールのウィンドウを含む Figure のハンドルを使用して、ウィンドウを画面の中心に配置します。

sz = get(groot,"ScreenSize");
pos = get(imgcf,"Position");
pos = [(sz(3)-pos(3))/2 (sz(4)-pos(4))/2 pos(3) pos(4)];
set(imgcf,Position=pos)

Figure Image Tool 1 - I contains an axes object and other objects of type uimenu, uitoolbar, uipanel. The hidden axes object contains an object of type image.

出力引数

すべて折りたたむ

イメージを含む現在の Figure。figure オブジェクトとして返されます。

ヒント

  • imgcf は、イメージ ツールで使用される Figure の取得に役立ちます。ツールの Figure は gcf では取得できません。

バージョン履歴

R2006a より前に導入

参考

| | |