• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

C++ Progaming help

tweeve2002

Senior member
I am building a C++ Program and cant figure out how to use bitmaps in my program. The program runs in Dos since I'm just starting. I have searched google but cant find any code that works...any help would be great.
 
I agree with diego. Using bitmaps from DOS is a fairly non-trivial task. Essentially you have to program the graphics hardware directly. You choose a graphics mode, exec a couple of BIOS interrupts to set up the display adapter, decode your image format (or read it from disk if its raw), extract the palette, write the image data into the correct places in system ram (the addresses the display memory is mapped into), and you have a graphic 🙂. Lots and lots of programming.

If you absolutely have to do this from DOS I would look at either a free image library or a shareware one like Fastgraph. But I would absolutely not jump through these hoops, as much of the knowlege you gain will be useless in any real world context. Best thing to do is program in Windows right from the start. To begin learning C++ you can just build simple console apps (essentially what DOS is under Windows), and then move on to using the .Net framework to build gui apps and display graphics.
 
Yes, learning Win32 GDI or .NET GDI+ makes much more sense than learning an obsolete and irrelevant DOS 2D library that might only support standard VGA resolutions.

MS has free versions and 6-month eval versions of their .NET dev tools. Dev C is much more of a niche tool on the Windows platform than MS tools.
 
Call me kooky, but I would assume that by 'DOS' he simply means he's writing a cli app. I really doubt he's compiling an app in DevC++ in Windows and targetting a real DOS environment.
 
Originally posted by: Nothinman
Call me kooky, but I would assume that by 'DOS' he simply means he's writing a cli app. I really doubt he's compiling an app in DevC++ in Windows and targetting a real DOS environment.
Ah, in which case the answer is: you can't. A console window is text-based, the best you can do in it is say Curses!

Either grab a copy of Petzold for Win32 non-console development, or replace Dev C with an MS .NET tool and the tutorials at msdn.microsoft.com
 
Back
Top