Solved

Sending Graphics to a Printer

Posted on 1997-06-30
14
236 Views
Last Modified: 2010-04-10
How do you send graphics (i.e. not ascii characters) to the printer? Preferably for free. DOS Borland C++.
0
Comment
Question by:Adrian031197
  • 5
  • 5
  • 3
  • +1
14 Comments
 
LVL 3

Expert Comment

by:LucHoltkamp
ID: 1164170
Which printer?
0
 

Author Comment

by:Adrian031197
ID: 1164171
My printer is a Canon BJC-4550, but a generic method would be nice.
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1164172
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.

0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Accepted Solution

by:
AVaulin earned 50 total points
ID: 1164173
Use PCX Toolkit by Genus Microprograming Inc. There are functions to print graphics in this library. Moreover there are many other useful functions in it.
0
 

Author Comment

by:Adrian031197
ID: 1164174
Where do I get it, and how much does it cost?
0
 
LVL 4

Expert Comment

by:AVaulin
ID: 1164175
It cost $175. You can find it at http://www.provantage.com/CO__GNUS.HTM
0
 

Author Comment

by:Adrian031197
ID: 1164176
So it's a whole lot easier to print from Windows than DOS?
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1164177
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.

0
 
LVL 4

Expert Comment

by:AVaulin
ID: 1164178
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.
0
 

Author Comment

by:Adrian031197
ID: 1164179
Well then, is there a freeware or similar toolkit? And what is the best way to do Windows (3.1 or 32) programming?
0
 
LVL 4

Expert Comment

by:AVaulin
ID: 1164180
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.
0
 

Author Comment

by:Adrian031197
ID: 1164181
How much does it (I guess VC++ is Visual C++) cost? Is it harder than DOS programming?
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1164182
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 !!
0
 
LVL 4

Expert Comment

by:AVaulin
ID: 1164183
I can only sign under RONSLOW words.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question