Results 1 to 3 of 3

Thread: How to load a Bitmap from a resource?

  1. #1

    How to load a Bitmap from a resource?

    I just started exploring SDl and I was wondering if anybody has an idea how to load a bitmap onto an SDL_Surface from a resource?

  2. #2

    Re: How to load a Bitmap from a resource?

    Quote Originally Posted by Paulius
    I just started exploring SDl and I was wondering if anybody has an idea how to load a bitmap onto an SDL_Surface from a resource?
    Hi Paulis,
    You will need to Load the Resource into a stream ( check this article to find out how http://community.borland.com/article...,16081,00.html ) and then use JEDI-SDL's LoadSDLBMPFromStream function which exists in SDLStreams.pas and returns a PSDL_Surface.

    Remember to free your PSDL_Surface when you finish with them, to avoid memory leaks.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #3

    How to load a Bitmap from a resource?

    Thanks for your help, but I wanted to put a bitmap into an executable to avoid space waste, because it's only 3k. I want to make the whole application under 32k so I'll have to pass on VCL units. I have seen people loading a bitmap from resource with LoadImage windows API call and bliting it onto DirectDraw surface (I think SDL uses DirectDraw in windows?) so there should be a way to do this without streams.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •