Solved

Sending Graphics to a Printer

Posted on 1997-06-30
14
233 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now