mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-06 03:07:54 +08:00
Save icon's as .bmp
.ico hack was unneccassary.
This commit is contained in:
parent
77afcc2293
commit
b576ee300b
@ -35,6 +35,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
|
|
||||||
private List<ControlPanelItem> controlPanelItems;
|
private List<ControlPanelItem> controlPanelItems;
|
||||||
private string iconFolder;
|
private string iconFolder;
|
||||||
|
private string fileType;
|
||||||
|
|
||||||
#endregion Properties
|
#endregion Properties
|
||||||
|
|
||||||
@ -43,12 +44,13 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
this.context = context;
|
this.context = context;
|
||||||
controlPanelItems = WindowsControlPanelItems.List.Create(48);
|
controlPanelItems = WindowsControlPanelItems.List.Create(48);
|
||||||
iconFolder = @"Images\ControlPanelIcons\";
|
iconFolder = @"Images\ControlPanelIcons\";
|
||||||
|
fileType = ".bmp";
|
||||||
|
|
||||||
foreach (ControlPanelItem item in controlPanelItems)
|
foreach (ControlPanelItem item in controlPanelItems)
|
||||||
{
|
{
|
||||||
if (!File.Exists(iconFolder + item.ApplicationName + ".ico"))
|
if (!File.Exists(iconFolder + item.ApplicationName + fileType))
|
||||||
{
|
{
|
||||||
item.Icon.ToBitmap().Save(iconFolder + item.ApplicationName + ".ico"); //Wierd hack to not lose quality when saving as .ico
|
item.Icon.ToBitmap().Save(iconFolder + item.ApplicationName + fileType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,7 +74,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
{
|
{
|
||||||
Title = item.LocalizedString,
|
Title = item.LocalizedString,
|
||||||
SubTitle = item.InfoTip,
|
SubTitle = item.InfoTip,
|
||||||
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + ".ico",
|
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + fileType,
|
||||||
Action = e =>
|
Action = e =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -93,7 +95,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||||||
{
|
{
|
||||||
Title = item.LocalizedString,
|
Title = item.LocalizedString,
|
||||||
SubTitle = item.InfoTip,
|
SubTitle = item.InfoTip,
|
||||||
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + ".ico",
|
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + fileType,
|
||||||
Action = e =>
|
Action = e =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
Loading…
Reference in New Issue
Block a user