CImageList::ExtractIcon

更新 : 2007 年 11 月

イメージ リスト内のイメージと関連するマスクを基にアイコンを作成します。

HICON ExtractIcon(
   int nImage 
);

パラメータ

  • nImage
    イメージの 0 から始まるインデックス。

戻り値

正常終了した場合は、アイコンのハンドルを返します。それ以外の場合は NULL を返します。

解説

このメソッドは、アイコンの作成を ImageList_ExtractIcon マクロの動作に依存しています。アイコンの作成と削除の詳細については、ImageList_ExtractIcon マクロを参照してください。

使用例

int   i, dx, cx, cy, nCount = m_myImageList.GetImageCount();
HICON hIcon;

::ImageList_GetIconSize(m_myImageList, &cx, &cy);

// Draw the images of the image list on the DC.
for (dx = 0, i = 0; i < nCount; i++)
{
   hIcon = m_myImageList.ExtractIcon(i);

   dc.DrawIcon(dx, 0, hIcon);
   dx += cx;
}

必要条件

ヘッダー : afxcmn.h

参照

参照

CImageList クラス

階層図

CImageList::Replace

その他の技術情報

CImageList のメンバ