Link to home
Start Free TrialLog in
Avatar of Adrian031197
Adrian031197

asked on

Sending Graphics to a Printer

How do you send graphics (i.e. not ascii characters) to the printer? Preferably for free. DOS Borland C++.
Avatar of LucHoltkamp
LucHoltkamp

Which printer?
Avatar of Adrian031197

ASKER

My printer is a Canon BJC-4550, but a generic method would be nice.
At DOS level there is no generic level - because there is no printer graphics support.  You would have to generate the right codes for your printer.  Other than that, buy/find a graphics library for DOS.

If it is line drawings you want, try generating HPGL codes - there is a sharewaare utility called PrintGL which will ouput HPGL drawings to printer or screen.

Even better, use Windows instead (if possible) as it lets your create a graphic "windows" for a printer, so you can draw on a printer just like the screen.

ASKER CERTIFIED SOLUTION
Avatar of AVaulin
AVaulin
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Where do I get it, and how much does it cost?
It cost $175. You can find it at http://www.provantage.com/CO__GNUS.HTM
So it's a whole lot easier to print from Windows than DOS?
Printing graphics is easy from Windows (well, as easy as graphics are on the screen) - what you see is what you print.

Outputing text in windows is not as simple (in terms of lines of code) as DSO, but is much more powerful and flexible.

Windows is a different kettle of fish to DOS - a bit like comparing C++ to assembler.  It provides a very rich environment for both users and developers.  There is a learning curve when going from a simplistic OS like DOS to a messaging (almost object -oriented) system like Windows.  But it is well worth the effort - especially if you do the sensible thing (if possible) and forget about Windows 3.1 and go to Win32 (ie. Windows 95/NT).  
Win32 is even richer and more stable than Windows 3.1 and is really easier.  This is because it is a complete operating system on its own (doesn't live on top of DOS) and is 32 bit and virtual (so no medium models and 640K limits etc.)

If I was going to spend some money, I'd spend it on moving to Win32 development tools, rather than on DOS.  Of course, your cicumstances may not allow this.

There are functions pcxBufferPrint, pcxFilePrint and other in PCX Toolkit which very easy to use. But as RONSLOW said Windows (especially Win95/NT) do most job with graphics instead you. But your first question was about DOS. PCX Toolkit is one the best toolkit which help you do what you want under DOS.
Well then, is there a freeware or similar toolkit? And what is the best way to do Windows (3.1 or 32) programming?
I'm sure that there is free code which do what you want (but I don't know where). About programming platform: you must decide what platform you want use. Win is very popular in whole world. Many companies chose Win'95. I use and recommend Win'95 and VC++ and of course 32-bit programming (there are many advantages to choose 32-bit, you can learn about them from any book).
Good luck.
How much does it (I guess VC++ is Visual C++) cost? Is it harder than DOS programming?
Check with your local retailer about code.  You may be able to get the educational version which is cheaper.

VC++ is Visual C++ which is now also part of the Visual Tools suite.  If you just want C++ then get VC 5; if you want other languages then get the Visual Tools suite.

Unless you are developing client/server applications or major web-based apps, the professional version is OK - no need for enterprise version.

Windows programming without C++ is not as easy as dos, because it has a larger API and is an event driven  message based system, so you need to change the way you think of programs.  A simple Hello-World program in windows is several pages long because of the house-keeping you need to do to set up windows and start applications.

However, with VC++ and MFC, most of this is hidden from you, the API is encapulated into classes to make it more palettable, and VC will write the skelton application for you and help you fill in the details.

The VC++ development environment is really nice and well intergrated.  It's a joy to develop programs.  It includes browsers and integrated debugging and help and lots of nice goodies.

Of course, if you want, you can still write what is called "console mode" applications, which are pretty much like good old DOS applications, but are 32-bit and you have access to most of the Win32 API functions for file system, etc etc.  However, you cannot (easily) do graphics in a console mode app.  But, if you don't like event driven program and just want to write a (literally) ten line program, then that is still possible under Win32.

Unless there is some really good reason why you have to support DOS and/or Win 3.1, I'd forget about that platform and go 32-bit Win32 ASAP.  Of course, if you have a graphical application, then you will need to re-write your graphics to fit into the Win32 system.  If your application is more file or text based, then it shouldn't be too hard to make it work in Win32, either as a console mode app, or slotting the appropriate parts into a VC generated Win32 skeleton app.

Good luck !!
I can only sign under RONSLOW words.