-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot get icons with Icon.FromResources #2164
Comments
The Icon/Image must be an Embedded Resource. In your csproj, something like this is usually helpful:
Hope this helps. |
After asking a while, I am assuming Eto has limits and these unexposed properties cannot be changed? |
For properties that aren't exposed, or platform-specific functionality you can use native styles. E.g. this would fix it for you: myTabControl.Styles.Add<Eto.Wpf.Forms.Controls.TabPageHandler>(null, h =>
{
if (h.Control.Header is System.Windows.Controls.StackPanel stackPanel)
{
var textBlock = stackPanel.Children.OfType<System.Windows.Controls.TextBlock>().FirstOrDefault();
if (textBlock != null)
{
textBlock.VerticalAlignment = System.Windows.VerticalAlignment.Center;
}
}
}); That being said, I think having it centred by default would make sense so I've added #2197 to get that fixed up. Do note that other platforms may limit the logical size of the icon to 16x16 (e.g. MacOS, WinForms). Closing this issue as it has been answered. |
Expected Behavior
Getting the icons with Icon.FromResources
Actual Behavior
Error
System.ArgumentException: 'Resource 'Terrain.Resources.Terrain.png' not found in assembly 'Terrain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
Parameter name: resourceName'
Steps to Reproduce the Problem
Code that Demonstrates the Problem
Specifications
The text was updated successfully, but these errors were encountered: