■ 시스템 아이콘을 구하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; ... Size iconSize = SystemInformation.SmallIconSize; Bitmap iconBitmap = new Bitmap(iconSize.Width, iconSize.Height); Icon targetIcon = null; using(Graphics iconGraphics = Graphics.FromImage(iconBitmap)) { iconGraphics.InterpolationMode = InterpolationMode.HighQualityBicubic; iconGraphics.DrawImage(SystemIcons.Error.ToBitmap(), new Rectangle(Point.Empty, iconSize)); targetIcon = Icon.FromHandle(iconBitmap.GetHicon()); } |