题目中说的很清楚,我想在我的WPF程序中使用imageres.dll
中的特定图标作为应用程序图标。
怎么做呢?
编辑:我已手动从DLL中提取了图标,但有没有更简单/更“正确”的方法?
public static ImageSource ToImageSource(this Icon icon)
{
ImageSource imageSource = Imaging.CreateBitmapSourceFromHIcon(
icon.Handle,
Int32Rect.Empty,
BitmapSizeOptions.FromEmptyOptions());
return imageSource;
}