Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Window Icon doesn't show properly  (Read 3850 times)

0 Members and 1 Guest are viewing this topic.

Xardas2

  • Newbie
  • *
  • Posts: 5
    • View Profile
Window Icon doesn't show properly
« on: August 20, 2009, 11:28:57 am »
Hi all together.


I've got a problem with the window icon.
It isn't draw corectly, only a few pixels are visible and I don't know why.
Maby something is wrong with my code.

Code: [Select]
sf::RenderWindow App(sf::VideoMode(300,300,32), "Test");
sf::Image img_icon;

img_icon.LoadFromFile("icon_error.png");

App.SetIcon(img_icon.GetWidth(), img_icon.GetHeight(), (sf::Uint8*)&img_icon);


I use a 15 x 15 .png image but .jpg also doesn't work.

I've uploaded the code hier:
http://sfml15-seticont.sourceforge.net

Thanks for your help.

Avency

  • Full Member
  • ***
  • Posts: 113
    • View Profile
Window Icon doesn't show properly
« Reply #1 on: August 20, 2009, 12:27:02 pm »
The following code works:
Code: [Select]
App.SetIcon( img_icon.GetWidth(), img_icon.GetHeight(), img_icon.GetPixelsPtr());

The memory location of the img_icon isn't the location of the array of pixels.

Quote
I've uploaded the code hier:
http://sfml15-seticont.sourceforge.net

I don't think that it's a good idea to create a new sf.net project just to upload some files. There are enough other free uploading services available.

Xardas2

  • Newbie
  • *
  • Posts: 5
    • View Profile
Window Icon doesn't show properly
« Reply #2 on: August 20, 2009, 01:19:11 pm »
Thank you.

Now it works fine. ^^


I agree with you, that the sf.net project wasn't the right solution.
Next time I will upload the files otherwhere.