■ 아이콘 구하기 예제

----------------------------------------------------------------------------------------------------

using System.Drawing;

 

Bitmap bitmap = new Bitmap("c:\\icon.png");

 

Icon icon = GetIcon(bitmap);

----------------------------------------------------------------------------------------------------

 

■ 아이콘 구하기

----------------------------------------------------------------------------------------------------

using System.Drawing;

using System.IO;

 

#region 아이콘 구하기 - GetIcon(bitmap)

 

/// <summary>

/// 아이콘 구하기

/// </summary>

/// <param name="bitmap">비트맵</param>

/// <returns>아이콘</returns>

public Icon GetIcon(Bitmap bitmap)

{

    Icon icon = Icon.FromHandle(bitmap.GetHicon());

 

    using(MemoryStream stream = new MemoryStream())

    {

        icon.Save(stream);

    }

 

    return icon;

}

 

#endregion

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG