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

Author Topic: Loading an image from a .rc file  (Read 12385 times)

0 Members and 1 Guest are viewing this topic.

devlin

  • Full Member
  • ***
  • Posts: 128
    • View Profile
Loading an image from a .rc file
« Reply #30 on: January 31, 2011, 05:25:40 pm »
Because LoadFromMemory doesn't support DIBs (nor should it, really), and the header differs between BMP and DIBs? :)

Prominence256

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://GameMakerStation.110mb.com/
Loading an image from a .rc file
« Reply #31 on: February 01, 2011, 12:36:56 am »
Okay, I just used sf::Sprite::FlipY and everything's just fine. Thanks for all the help everybody! :D

Disch

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Loading an image from a .rc file
« Reply #32 on: February 01, 2011, 05:09:46 am »
Quote
Because LoadFromMemory doesn't support DIBs (nor should it, really), and the header differs between BMP and DIBs?


Is that even true?

I really didn't think there was any difference between the two.  Bitmaps are bitmaps.  It's a pretty standard format, I thought.

Quote
Okay, I just used sf::Sprite::FlipY and everything's just fine. Thanks for all the help everybody!


Blech.  This isn't a solution.  It's a hack, and you shouldn't be the least bit satisfied with it.

The obvious solution here would be to just use a supported image format.  Is there any reason you can't?

Prominence256

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://GameMakerStation.110mb.com/
Loading an image from a .rc file
« Reply #33 on: February 01, 2011, 06:14:22 pm »
Well, is there any way to load a png from a .rc file using FindResource, LoadResource, and LockResource?

And according to wikipedia dib's and bmp's do have different headers.

Disch

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Loading an image from a .rc file
« Reply #34 on: February 01, 2011, 06:29:06 pm »
Quote from: "Prominence256"
Well, is there any way to load a png from a .rc file using FindResource, LoadResource, and LockResource?


Yes.

Find/Load/Lock the resource, then sf::Image::LoadFromMemory

Quote
And according to wikipedia dib's and bmp's do have different headers.


Interesting.  Learn something new every day I guess.