17,741
社区成员
发帖
与我相关
我的任务
分享
Icon systemIcon = Icon.FromHandle(iconHandle);
if (systemIcon != null)
{
MemoryStream memoryStream = new MemoryStream();
System.Drawing.Bitmap bitmap = systemIcon.ToBitmap();
bitmap.Save(memoryStream, ImageFormat.Png);
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.StreamSource = memoryStream;
bitmapImage.EndInit();
bitmapImage.Freeze();
XXImage.Source = bitmapImage;
}