SFML community forums
Help => General => Topic started by: JeZ-l-Lee on February 06, 2009, 05:27:01 pm
-
Having trouble setting icon...App.SetIcon(32, 32, Icon);
sf::Image Icon;
if (!Icon.LoadFromFile("data/graphics/Icon.bmp"))
return EXIT_FAILURE;
App.SetIcon(32, 32, Icon);
What I do wrong?
Thanks...
-
Icon is not a const sf::Uint8*. Icon.GetPixelsPtr() is ;)
-
Got it working, thanks...
-
could you please show how you did it. I am trying really hard to put an icon
to my application, so far no result. I am having the same code as you..
App.SetIcon (32,32,icon);
latter I changed it to App.SetIcon (32,32,icon.GetPixelsPtr());
still not working. what might I have done?
-
could you please show how you did it. I am trying really hard to put an icon
to my application, so far no result. I am having the same code as you..
App.SetIcon (32,32,icon);
latter I changed it to App.SetIcon (32,32,icon.GetPixelsPtr());
still not working. what might I have done?
Did you load the icon properly? The following code is what I use and it works fine:
Image icon;
icon.LoadFromFile("image/icon.png");
window.SetIcon(256,256,icon.GetPixelsPtr());
(I'm only using 256x256 to support the max icon size possible, 32x32 should work fine as well.)