Skip to content

Commit

Permalink
Merge pull request #889 from WildernessLabs/jorge-winforms-icon-fix
Browse files Browse the repository at this point in the history
Switch icon.ico from resource to embedded resource
  • Loading branch information
jorgedevs committed Jan 22, 2024
2 parents 617d2c2 + 7383f9d commit 22a8546
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@
</PropertyGroup>
<ItemGroup>
<None Include=".\Readme.md" Pack="true" PackagePath="" />
<None Remove="icon.ico" />
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="icon.ico">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\icon.png" Link="icon.png" Pack="true" PackagePath="" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ public WinFormsDisplay(int width = 800, int height = 600, ColorMode colorMode =
this.DoubleBuffered = true;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.StartPosition = FormStartPosition.CenterScreen;
this.Icon = new Icon("icon.ico");

var iconStream = typeof(WinFormsDisplay).Assembly.GetManifestResourceStream("Displays.WinForms.icon.ico");
this.Icon = new Icon(iconStream!);

_buffer = new WinFormsPixelBuffer(width, height, colorMode);
}

Expand Down

0 comments on commit 22a8546

Please sign in to comment.