Jump to content
  • Advertisement


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


Images ??

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

Okay, I have been learning C++ in school and taken two classes and none of them have taught me how to display an image--at all--so if somebody would be so kind as to tell me how I would do that, preferrably with transparencies, bitmap perhaps?? I would be much abliged.(is that how you spell it?)

Share this post

Link to post
Share on other sites
It''s "obliged."

Anyway, how do you display an image? That depends on what OS you''re under. If you''re using DOS (and the wonderful Mode13h) you''ll have to read in the bitmap file yourself and display the pixels yourself. Code to do that is available at http://www.cprogramming.com/boardfaq.html#pic

If you''re using Windows, there are several techniques. You could use the GDI (standard Windows stuff) (See http://sunlightd.virtualave.net/Windows/ ) or you could use an API of some sort. Since you referred to transparency, I''m assuming you want to do something with sprites, in which case you''ll want to use DirectDraw7 (I know, DX8 is out, but it doesn''t have vanilla DirectDraw like DX7, so I''d use 7 for 2d stuff. See http://www.gamedev.net/reference/articles/article608.asp). Some APIs generally more tailored to 3D can do simple (and sometimes complicated) 2d stuff as well, so you could also use OpenGL or DirectX8. Finally, you could use a graphics library like Allegro. Allegro, for one, comes in both Windows and DOS versions.

So there are your options. But if all you want to do is display a bitmap, I''d use Windows GDI.

Share this post

Link to post
Share on other sites

  • 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!