private Bitmap GetBitmap(MessageLabelIcon icon)
        {
            if (icon == MessageLabelIcon.None)
                return null;

            IntPtr iconHandle;

            Win32.LoadIconMetric(IntPtr.Zero, new IntPtr((int)icon), 0, out iconHandle);

            try
            {
                return Utils.ToBitmap(iconHandle, 16, 16);
            }
            finally
            {
                Win32.DestroyIcon(iconHandle);
            }
        }
Exemple #2
0
        private Bitmap GetBitmap(MessageLabelIcon icon)
        {
            if (icon == MessageLabelIcon.None)
            {
                return(null);
            }

            IntPtr iconHandle;

            Win32.LoadIconMetric(IntPtr.Zero, new IntPtr((int)icon), 0, out iconHandle);

            try
            {
                return(Utils.ToBitmap(iconHandle, 16, 16));
            }
            finally
            {
                Win32.DestroyIcon(iconHandle);
            }
        }