Advertisement

Display a bitmap image in a console app

Started by March 05, 2002 08:46 PM
5 comments, last by gamefr 22 years, 9 months ago
Is this possible to do if so how is it done in a console application ( not a win32 app). thx in advance "Only to be a humble programmer is a goal I must achieve..."
"Only to be a humble programmer is a goal I must achieve..."
in a DOS app(not win32 console)? what compiler are you using?
Advertisement
Not unless you do some REALLY tricky stuff (by that I mean you go behind the operating system''s back, grab the handle of the console window, and paint your bitmap into it using bitblt; you can probably do this but it''s really not worth it.). I''d suggest using a Win32 app; they are painfull to work with and quite confusing at first, but that''s what everyone else is using so you might as well learn how to as well.
Hello,

I believe you can do so (with a DOS application, most probably that wouldn't work with a Win32 console app). If you have a DOS-based C/C++ compiler (i.e Turbo C), you can use the old graphics stuff (BGI)
#include <graphics.h>main(){int iDriver = DETECT, iGfxMode = VGA;initgraph(&iDriver, &iGfxMode, "..\\BGI");..// The following two functions you should write yourself (or search for a free libraryParseBMPFile();    RenderBMP();..closegraph();}  


Hope that helps,
IDispatch

Edited by - idispatch on March 6, 2002 2:04:22 AM
my compiler is VC++ and yea I''m trying to learn win 32 but I just wanted to know if it was easier to do in a console application


"Only to be a humble programmer is a goal I must achieve..."
"Only to be a humble programmer is a goal I must achieve..."
Unfortunately no
It you want to do graphics you really do need to make a win32 application.
Advertisement
Check out the SDL tutorials here or at www.libsdl.org. You can have a bitmap up and running in only a few lines of code.

This topic is closed to new replies.

Advertisement