Using jpg images whit C

This is a discussion on Using jpg images whit C within the C Programming forums, part of the General Programming Boards category; Hello I am new to programming, and I have to do program in c that uses pictures and I want ...

Using jpg images whit C

Hello I am new to programming, and I have to do program in c that uses pictures and I want to re size the console window, but for some reason i get a bunch linker errors(I have no clue how to fix those). I Have to use the graphics.h Library and Devc++

I already have libbgi.a in the folder devcpp/lib and graphics.h in devcpp/include
-lbgi
-lgdi32
-lcomdlg32
-luuid
-loleaut32
-lole32
I already set up the parameters and the pictures are in the same folder as the program can someone tell me what i am doing wrong, do I need to do something more??? or did I messed up somewhere in the parameters area??

The console window is a text based window, quite unsuitable to try and display a picture. You need a graphics window, and it has to be one that is supported by your compiler or library, and current operating system.

BGI graphics died with Win2000 when Windows stopped allowing direct access to hardware (and particularly video hardware). Under Vista and Win7 it is no longer possible to have a full screen DOS window with video mode switching (at least not without some serious messing about with the system) and if the OS is 64 bits it's entirely likely the program wouldn't run anyway.

BGI graphics work fine in Windows XP (x32 bit), with the default installation. That's one reason I stuck with Turbo C for such a long time.

Is that what devC used, BGI graphics?

In Windows 7 or Vista (x64 bit), you can run them (I'm told), by using DOSBox to set up the virtual environment. I have never tried this however.

Nothing on Google about it?

Sigh... more "old think"... Why on earth would you butcher a modern operating system into looking like a quarter century old antique?

The best and probably easiest way is to move up to GUI mode programming and CGI (or better) graphics using the real-deal message/event driven API. Not only will it be faster, it will actually do stuff console mode can't. *Nobody* writes console code anymore, except during training and (rarely) for quicky utility programs. Even the most basic GUI mode stuff makes console code look, well, stupid.

To give you but one of many examples... compare user input via an edit child to fgets() or scanf()... it's simply no contest.

Heck, I'd never even written a Windows console program in C until I started helping out on these forums... and when working with Pascal I don't think I ever did.

I'm NOT recommending BGI graphics, just saying that it works on Windows XP, not just on Windows2000.

That is all.

OK... (EDIT: I just re-read my message and realize you could have misunderstood my point... sorry about that)

The message for the OP is that he would do well to learn GUI mode programming anyway since it is very likely any application he creates (either professionally or as freeware/shareware) is going to have to be windowed if he expects people to use it.

Recent experience... I wrote a quick and dirty disk scanner for a client who's updating all his drives (500gb out, 2.5tb in 30+ drives). All it was supposed to do was open each file and read it from end to end to ensure a good copy was made during the transfer, so I just built a quick and dirty console app and put it in his folder for him to pick up on the VPN... Next morning I gets a phone call... "We got your program but nobody here understand it. Can you come over?" So I heads off across town and when I get there, they've clicked on the program like 50 times, and it just shows the instructions... so I closes all the copies on the desktop... goes WIN_R, types in the program name and drive letter (scan d: ... like it's hard?) and off it went. They honestly had an office full of so called "computer smart" people who had never run a console program before! ... As soon as it didn't produce an OK button they were lost... I'll not repeat that mistake. (Their files were fine, by the way)

This is the level it's reached. Console programming is viewed as esoteric or "legacy" and nobody wants to deal with it. A programmer, these days, who doesn't use Windowed UIs isn't going to get very far...