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

Author Topic: Help loading Images  (Read 2023 times)

0 Members and 2 Guests are viewing this topic.

codicil793

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Help loading Images
« on: April 05, 2014, 12:39:44 am »
I am trying to load bitmaps that I have saved in the resources section in Visual Studio 2012. It seems that this is not possible so where would I need to place a bitmap resource file and by what name would I reference it?

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: Help loading Images
« Reply #1 on: April 05, 2014, 01:08:25 am »
If you are placing them in a fold that holds them drop that fold into the Degun and/or Release folders inside your bin folder of your project and it should find them.  As for having them as resource files you'll need to convert them to a byte array or something to let SFML use them.  >.>
I have many ideas but need the help of others to find way to make use of them.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10998
    • View Profile
    • development blog
    • Email
AW: Help loading Images
« Reply #2 on: April 05, 2014, 09:02:47 am »
Resources should be placed in the working directory, for VS this can be configured in the project options under the section debugger.

To load from the resource data you'd have to do a bit more research, it should be possible somehow.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

codicil793

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Help loading Images
« Reply #3 on: April 05, 2014, 06:54:44 pm »
Running my program was giving me a BadImageFormatException so I assumed this was due to me not entering a valid image file location. This was actually due to missing external libraries, which I have now added. The program just crashes now, with a single call to create a new render window.
« Last Edit: April 08, 2014, 08:37:57 am by codicil793 »

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Help loading Images
« Reply #4 on: April 08, 2014, 03:17:08 pm »
If you provide a complete and minimal example (see: https://github.com/SFML/SFML/wiki/FAQ#tr-grl-minimal ) it will be a lot easier to help you.
Have you tried stepping through the program in a debugger?
Are you sure you are not mixing debug and release versions of libraries/your own code?

codicil793

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Help loading Images
« Reply #5 on: April 08, 2014, 07:14:20 pm »
I created a new thread since I realized this was not the problem. This is my current issue: http://en.sfml-dev.org/forums/index.php?topic=14896.0

Thanks for your reply :-)

 

anything