
Issue: GameWindow Icon Support
Posted Friday, 21 November, 2008 - 17:54 by JTalton| Project: | The Open Toolkit library |
| Version: | 1.0-beta-1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I am getting to the point in my project where it would be nice to post screen shots. It would be nice to have Icon support for the GameWindow.


Comments
#31
The icon support works great. I did notice one quirk. If I use a multi resolution icon, it will pick a high resolution version and try to use it. This results in it scaling down the high resolution to 16x16, which looks grainy and the transparency does not look good. I ended up making a second icon just for the 16x16. I'm not sure what are the considerations for highe dpi settings or other operating systems than windows.
#32
Thanks.
This issue can be fixed easily on Windows by sending a second WM_SETICON message with wparam = ICON_SMALL.
X11 supports multi-res icons too, but we need the actual icon data for that. Do you know if there is any way to extract the different resolutions from a multi-res icon? (ToBitmap() returns only the first resolution).
#33
The small icon should now be set correctly on win32 when using multi-icon files. I don't have access to the platform right now, JTalton can you please test that the issue is fixed?
#34
"Do you know if there is any way to extract the different resolutions from a multi-res icon? (ToBitmap() returns only the first resolution)"
"The small icon should now be set correctly on win32 when using multi-icon files"
I'll test this soon and post the results.
#35
IconBitmapDecoder is part of WPF, and I think not supported under mono. The only way to do it as far as I can tell is to save the icon to memory like that and then parse the ico file format. There is some example source code for doing that here:
http://www.codeproject.com/KB/vb/MultiIcon.aspx
#36
Thanks for the hints.
SVN trunk actually contains a fully featured Icon parser picked straight out of Mono (disabled by default,
#define EXPERIMENTALto enable). I haven't decided what's the best way to proceed with this issue, yet: on one hand this code would allow OpenTK consumers to work without referencing System.Drawing at all (right now you cannot really use GameWindow without System.Drawing), but on the other hand that's a lot of code to maintain...#37
"The small icon should now be set correctly on win32 when using multi-icon files"
Tested - seems to work good on Windows.
#38
Thanks, marking this as fixed.
If you encounter any icon-related bugs, please open new bug reports!
#39
Closing issues fixed in 1.0 beta-1.