mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 04:55:39 +02:00
dynamically convert png to ico to reduce file size
This commit is contained in:
parent
dd20274ce3
commit
09f9717b48
7 changed files with 27 additions and 7 deletions
|
@ -251,7 +251,7 @@ namespace PersistentWindows.SystrayShell
|
|||
icon_path2 = Path.Combine(appDataFolder, "pwIconBusy.png");
|
||||
if (File.Exists(icon_path2))
|
||||
{
|
||||
var bitmap = new System.Drawing.Bitmap(icon_path2); // or get it from resource
|
||||
var bitmap = new System.Drawing.Bitmap(icon_path2);
|
||||
var iconHandle = bitmap.GetHicon();
|
||||
BusyIcon = System.Drawing.Icon.FromHandle(iconHandle);
|
||||
}
|
||||
|
@ -261,7 +261,8 @@ namespace PersistentWindows.SystrayShell
|
|||
}
|
||||
else
|
||||
{
|
||||
BusyIcon = Properties.Resources.pwIconBusy;
|
||||
var iconHandle = Properties.Resources.pwIconBusy.GetHicon();
|
||||
BusyIcon = System.Drawing.Icon.FromHandle(iconHandle);
|
||||
}
|
||||
|
||||
systrayForm = new SystrayForm();
|
||||
|
|
|
@ -71,12 +71,22 @@ namespace PersistentWindows.SystrayShell.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Icon pwIconBusy {
|
||||
internal static System.Drawing.Bitmap pwIconBusy {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("pwIconBusy", resourceCulture);
|
||||
return ((System.Drawing.Icon)(obj));
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap pwIconUpdate {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("pwIconUpdate", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,10 @@
|
|||
<value>..\Resources\pwIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="pwIconBusy" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\pwIconBusy.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<value>..\Resources\pwIconBusy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="pwIconUpdate" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\pwIconUpdate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="question" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\question.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 137 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
|
@ -123,6 +123,12 @@
|
|||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\pwIconBusy.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\pwIconUpdate.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(SolutionDir)*.bat $(TargetDir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue