Archived

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

nanoware

Images ??

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