Sign in to follow this  
FDaishi

SDL_image with MFC...?

Recommended Posts

Hello! I've been working on a small project that requires all sorts of image formats to be loaded and stored in a CBitmap class.. But I'm having problems linking an SDL Surface with MFC's CreateBitmap function. Here's the code that I have so far for loading the image..
	SDL_Surface *surface = IMG_Load("goose.bmp");

	HBITMAP bitmap = CreateBitmap(surface->w, surface->h, 3, 24, surface->pixels);
	m_Image.SetBitmap(bitmap);
	SDL_FreeSurface(surface);


I'm just trying to get it to work, but the screen comes up blank. I used the LoadImage function to load the same bmp and display it, and it works. But I need to be able to load the other formats, so that won't cut it.. I'd really appreciate it if someone could help me out, I'm getting frustrated with this.. :( -Fredric

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this