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

Author Topic: Limit to image size?  (Read 3717 times)

0 Members and 1 Guest are viewing this topic.

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Limit to image size?
« on: November 21, 2010, 06:54:05 pm »
hello im having a problem with my future game (lol)

the proble is that i cannot load my image correctly, well, better saying, the image wont show in my game

heres the important code

Code: [Select]
int main()
{
sf::View View(sf::FloatRect(1000, 4000, 1080, 4060)); //position of view
sf::Image map;
if(!map.LoadFromFile("worldmap2.png"))
        std::cout << "Didnt load map!" << std::endl;//this is sadly not the problem...
sf::Sprite mapp;
mapp.SetImage(map);
mapp.SetPosition(0,0); //set it to the right place
Game.Draw(mapp); //draw it
}


again, my problem is that when i compile, my other stuff shows, but not the map at all ._.

I'm using Code::Blocks with MingW compiler, and my image size is 5000,5000 pixels and 573 KB

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Limit to image size?
« Reply #1 on: November 21, 2010, 07:03:59 pm »
Quote
Limit to image size?

It is defined by your graphics card, and is probably not more than 4096x4096.
Laurent Gomila - SFML developer

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Limit to image size?
« Reply #2 on: November 21, 2010, 07:08:41 pm »
Quote from: "Laurent"
Quote
Limit to image size?

It is defined by your graphics card, and is probably not more than 4096x4096.



hmm..if thats the case then ill try this on my better computer(im on my crappy dell lol)

and if that doesnt help then ill try making the size smaller

thanks

Canadadry

  • Hero Member
  • *****
  • Posts: 1081
    • View Profile
Limit to image size?
« Reply #3 on: November 21, 2010, 07:11:58 pm »
I'll suggest you to reduce your picture. Even if you could load your picture.

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Limit to image size?
« Reply #4 on: November 21, 2010, 07:26:54 pm »
ok i now have it reduced to 500x500 and it still doesnt load at all...

i have also tried multiple formats(bmp jpg)

i know i had a problem like this before but it was from using different programs to make the image(still not sure why ._.)


anyone know what image creaor i should use? i use the game maker sprite editor and it works good

if thats not the case then what is?


EDIT: i made another image and it loaded just fine. im going to keep redusing the size some more...


ANOTHER EDIT: 50x50 not working either...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Limit to image size?
« Reply #5 on: November 21, 2010, 07:39:59 pm »
What error message do you get?
Laurent Gomila - SFML developer

molmasepic

  • Newbie
  • *
  • Posts: 43
    • View Profile
Limit to image size?
« Reply #6 on: November 21, 2010, 07:47:38 pm »
Quote from: "Laurent"
What error message do you get?



my bad..still no error message, just not showing

EDIT: ok i played around with the other stuff(images) and i got the map to pop an error in the console:

failed to create image, its internal size is too high <8192x8192>

not sure if this is a typo because my image is 5000x5000, in the meantime ima lower the size and mess with it some more


ANOTHER EDIT (lol): ok after playing around with this image, i have found out that the maximum size is 2000x2000(tested)

thanks for your time xD

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
Limit to image size?
« Reply #7 on: November 21, 2010, 09:05:14 pm »
The maximum size is 2048x2048 for you, in fact.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Limit to image size?
« Reply #8 on: November 21, 2010, 09:38:35 pm »
And if SFML says that it's 8192x8192 instead of 5000x5000, it's because your GPU doesn't support non power of two dimensions. So it picks the nearest valid dimension that can contain your 5000x5000 image.
Laurent Gomila - SFML developer

 

anything