Jump to content
  • Advertisement
Sign in to follow this  
tom_mai78101

How do you display the image that was imported into the Resource Viewer?

This topic is 3002 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

There's a image that is stored / imported / embedded into the executable file, via the Resource Viewer in Visual Studio.

I wanted to know, is it easy to make a pointer (like SDL's SDL_Surface pointers) and point it at the image, then try to display it using the WM_PAINT message (like how SDL_Blit works)?

Or is there more to it and I'm kind of missing something other than Resource Viewer and stuffs?

I'm trying to learn from MSDN Library, but it gets really confusing with each sentence I read pass. I don't know how to display the embedded image resource file, and I wanted to do that. But, I don't know what should I do with the imported image resource file when the Win32 application is running.

I have checked here and it didn't say "Displaying Bitmap" or something in the "Using Bitmaps" section.

What am I missing here? :(

Share this post


Link to post
Share on other sites
Advertisement
Using the GDI or SDL?

If using the GDI then here is a rough outline,

Step 1. Use LoadImage function to load the bitmap.
Step 2. Use CreateCompatibleDC to create a DC for it and SelectObject to select the bitmap into the DC
Step 3. Use BlitBlit in WM_PAINT to display it!

You can look these functions up on MSDN.


I dont know about SDL so I cant help you if you want to use that, its not clear from your post because you ask for functions likeSDL

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!