Problem when i load an XPM image

Hello,
i have a problem when i try to load an XPM image with SDL_Image.
I have converted my bmp image in XPM with Image-Magick.

Here the c++ code

#include “myimage.xpm”


SDL_Surface *xpmImage = NULL;
xpmImage = IMG_ReadXPMFromArray(myimage) //if i see the code of XPM generated, the name of array is myimage

I compile this with no error, but when i try to execute my apps, i have this error in debug:

“Unhandled exception a 0x00385285 in myApps.exe: Acces violation reading location 0x00000000”

What’s the problem?
tank’s

Hello,
i have a problem when i try to load an XPM image with SDL_Image.
I have converted my bmp image in XPM with Image-Magick.
snip

What’s the problem?
tank’s

without looking at the problem one thing i have found is that imagemagick will use the word black, brown red etc, instead of the hex code, which sdl_image xpm cant handle, or at least didnt last time i used image majic ;)On Tuesday 06 June 2006 10:38, NeGflar wrote:

without looking at the problem one thing i have found is that imagemagick
will use the word black, brown red etc, instead of the hex code, which
sdl_image xpm cant handle, or at least didnt last time i used image majic
:wink:

Hello,
I have seen the code but the colors are listed with exadecimal code.
I have the same problem with this simple code compiled with visual c++:

#ifdef WIN32
#pragma comment(lib, “SDL.lib”)
#pragma comment(lib, “SDLmain.lib”)
#pragma comment(lib, “SDL_image.lib”)
#endif

#include “SDL.h”
#include “SDL_image.h”
#include “myImg.xpm”

SDL_Surface *sfondo;

int main( int argc, char* args[] )
{

 if( SDL_Init( SDL_INIT_EVERYTHING ) == -1 )
{

      return false;
}

 sfondo = IMG_ReadXPMFromArray( myImg );

}

I think that the problem is in conversion
Instead of Image Magick, wich other program under Windows can i use for
convert a bmp to XPM?
Tank’s

#include “SDL.h”
#include “SDL_image.h”
#include “myImg.xpm”

Can you post a link to myImg.xpm so we can test it?

You can also enter a bug here:
http://bugzilla.libsdl.org/

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

#include “SDL.h”
#include “SDL_image.h”
#include “myImg.xpm”

Can you post a link to myImg.xpm so we can test it?

I have upload myImage.xpm here:

Tank’s