Archived

This topic is now archived and is closed to further replies.

loading/displaying bitmaps

This topic is 6359 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

Ok, although I really wish Microsoft would have made loading and displaying bitmaps simpler, they have done otherwise. My only hope is that in later releases of DirectX they will simplify this whole God-awful procedure. Well, it''s only a nightmare to me now because I don''t know how to do it, but once I learn how, I think I will love it. Anyway, here''s what I think has to happen. Of course, this is probably not right, the point is for you to look at it and fix it so that it is. 1.) Create DirectDraw Object 2.) Create Primary Surface 3.) Create Backbuffer 4.) Use LoadImage() to Load a Bitmap Into a Handle 5.) Create an Off-Screen Surface to Hold the Bitmap 6.) Blit the Bitmap to the Backbuffer 7.) Flip the Backbuffer and Primary Surface (display image) Now, am I right so far, or else where have I gone wrong? I know how to do steps 1, 2, 3, and 7, but I''m a little shaky on how to use the LoadImage() function, create an off-screen surface capable of holding the image, and blitting the bitmap to the backbuffer. Hell, I''m more than shaky, I have no freaking clue of how to do it! If someone could just write a little bit of code showing steps 4 through 6 (heavily commented if you don''t mind ) I would be much obliged. Thanks. --- Joker2000 Stevie Ray Vaughan - The Legend

Share this post


Link to post
Share on other sites
Hey Joker,

I don''t know much about the LoadImage function, but I know another way to use your images. You can include custom resources into your exe, and blit this to your surface. It real easy! If you want to know more about Using Custom Resources you can check out my homepage tutorial. It''s about loading your TGA image as a OpenGL texture, but you can probably rewrite the code for your own use...

Share this post


Link to post
Share on other sites