LQVGA: A VGA to Epson Print Screen Utility Version 1.70 Copyright (c) 1992 Ares Technologies. All Rights Reserved. VGA is a trademark of International Business Machines Corporation. All other trademarks are the property of their respective owners. LQVGA: A VGA to Epson Print Screen Utility LQVGA is Terminate-and-Stay-Resident (TSR) program that allows you to print any VGA or Super VGA screen to an Epson, Canon Bubble Jet, IBM Graphics printer or any compatible printer. With a memory overhead of only 18k, you can print anything you can display on your VGA card - graphics, text, even hi-res text and 256-color screens! LQVGA is simple to use. Just run the command LQVGA, and you're ready to print anything! Hitting the Print Screen key (PrtSc) will activate LQVGA, causing it to print your current screen to the printer. Text screens print just like they look, with lines and other special characters you don't usually get. Graphics screens are automatically scaled to the resolution and page you choose. ALL NEW! LQVGA is an adaption of the popular LJVGA program. The original LJVGA could only print to HP LaserJet compatible printers. LQVGA brings this exciting capability to users of many other printers. USING LQVGA Using LQVGA is simple. Running the command LQVGA will load LQVGA as a TSR. LQVGA will load with its default options, allowing you to print most any text or graphics screen by simply hitting the Print Screen key. You can modify the default options by using a combination of command-line switches, either the first time you run LQVGA, or later to modify the options already loaded in memory. LQVGA cannot be loaded twice. If you have already loaded LQVGA, it will update the copy in memory when you run it again. LQVGA supports several different command-line switches. These can be entered alone or as a group to change the default behavior of LQVGA. Be aware that when you use LQVGA to update a TSR already in memory, all options are reset to their defaults. Therefore, you must be careful to use all appropriate options each time you run LQVGA. LQVGA can also read its options from the DOS environment. When it is run, LQVGA will look for the environment variable "LQVGA". If "LQVGA" is set, LQVGA will read the value as if it were entered on the command-line. The environment is read first, so settings entered on the command-line will override any settings entered in the environment. See the examples below for more information. The possible options are listed below. -? Print synopsis. This option prints a copyright notice and a short summary of options. No other action is taken if you use this option. -d Disable LQVGA. This option will cause LQVGA to return control to the previously loaded print-screen routines (usually in the system BIOS). This option does not remove LQVGA from memory. -e Enable LQVGA. This option will enable LQVGA if it has been previously disabled. LQVGA will regain control with the settings it had when it was disabled. -u Unload LQVGA. This option will disable LQVGA and remove it from memory. LQVGA will only unload if it is the last TSR loaded. -n Instant print. This option will cause LQVGA to immediately print the current screen without becoming resident. This option can be used to run LQVGA from batch files, and could be used to create a primitive file printing program. This option will cause LQVGA to ignore any previously loaded copy, and will use only default options and options set on the command-line. -lN Set printer port. This option allows you to change the printer port LQVGA will print to. Possible values for N are 1 for LPT1, 2 for LPT2, or 3 for LPT3. You can also set N to 0 to print to PRN:. Note: Setting the printer port to 0 will also force LQVGA into DOS print mode (explained below). -pN Set print mode. This option allows you to change the method by which LQVGA sends data to the printer. This is useful in cases where you are using certain print redirectors or when you have a defective BIOS. Possible values for N are listed below. 0 - BIOS print mode. All printing is done through calls to the system BIOS. This is the default option and is the fastest print mode. This option should be chosen except in special situations. 1 - BIOS print mode with DOS Signalling. This print mode is intended for use with some network software. When using this mode, LQVGA prints all data through the system BIOS, but also uses DOS to open and close a phantom print file. This method can be used on certain networks to signal the beginning and ending of a print job. 2 - DOS print mode. When using this print mode, LQVGA prints all data through DOS calls. This option is included for situations in which compatibility is a problem, or where output should be redirected to special DOS devices. -rN Set resolution. This option allows you to set your printer's graphics resolution in dots-per-inch (DPI). Many different combinations of horizontal and vertical resolutions are available. See the -q option for more information on available resolutions. -ox Set page orientation. This option allows you to select portrait (upright) or landscape (sideways) graphics. Set x to "p" for portrait or "l" for landscape. The default is portrait graphics. -f Suppress form-feed. Normally, LQVGA will eject the page from the printer once it has finished printing the screen. This option will cause LQVGA to leave the page in the printer. -i Invert colors. This option will invert the colors for graphics screens so that white on the screen will print as black and vice-versa. Other colors are similarly reversed, printing a "negative" of the screen image. -aN Select dither algorithm. This option allows you to select the method LQVGA uses for creating the output image. The "dither" is the method by which LQVGA determines the pattern of dots to print on the output to simulate different colors. The different algorithms produce different results and are useful for different types of applications. Experiment with these options to see which works best for you. Possible values for N are listed below. 0 - Bayer-Dispersed algorithm. This is the fastest dither method and is the default. This is a good general-purpose algorithm and is characterized by cross-hatch patterns in the output. 1 - Bayer-Clustered algorithm. This is a modification of the Bayer-Dispersed algorithm and is commonly referred to as "halftoning." This method produces a pattern of different size dots producing an image similar to the pictures in a newspaper. 2 - Bayer Semi-Clustered. This is a variation of the Bayer-Clustered algorithm that produces four smaller dots rather than one large dot. Results are comparable to the Bayer-Clustered algorithm, but the resulting image is more pleasing due to the smaller dot size. 3 - Bayer Semi-Clustered Vertical algorithm. This is a modification of the Bayer algorithms which produces vertical line patterns in the image. This produces a very pleasing, consistent image, but results in very poor contrast. 4 - Floyd-Steinberg algorithm. This dither method is slower than the Bayer algorithms, but produces much better output for continuous-tone images. This is the same algorithm used in the original versions of LQVGA. -cN Set contrast. This option allows you to change the contrast of the printed output. Areas of similar color can be blended or accentuated using this option. Possible values for N range from -32 to 1024. Negative values decrease the contrast, with -32 corresponding to 50% grey output. Positive values increase the contrast, with 1024 corresponding to an image with only pure black and white. 0 is the default and results in no adjustment. -bN Set brightness. This option allows you to change the brightness of the printed output. The output can be made "blacker" or "whiter" with this option. Possible values for N range from -64 to 64. Negative values increase the black level, with -64 corresponding to a completely black image. Positive values increase the white level, with 64 corresponding to a completely white image. 0 is the default and results in no adjustment. -sN,N Set scaling. This option allows you to control the size of the printed image. LQVGA will normally scale the printed image to fill the page, but you can scale the size up or down with this option. This option takes a pair of numbers representing the x- and y-scaling respectively. Each number represents the number of printed pixels that will be used to represent each screen pixel in the respective direction. For example, -s3,3 means that for each pixel on the screen, LQVGA will print a box 3 pixels wide by 3 pixels long. With this option, you can set the scaling for a smaller image or for a larger image. If you specify a scaling factor greater than the maximum, the output image will be clipped to the dimensions of the page. You do not have to set both values. If either number given is 0, the scaling value for that direction will be determined from the value for the other direction in order to preserve the correct aspect ratio. Setting both values to 0 will result in the default, maximum-size image. For your reference in determining the appropriate scaling values, LQVGA assumes that the output must fit on a 8.25" x 10" page. The number of output pixels that this represents varies depending on the resolution chosen. Also, note that the x and y values correspond to screen dimensions, and thus may change depending on the page orientation selected. -z Load debugging code. This option will cause LQVGA to load an additional 1k of debugging code. This option can only be specified the first time LQVGA is loaded and cannot be disabled without unloading LQVGA. Once this option is loaded, LQVGA will produce an extra page containing information about the state of your VGA card each time you press the Print Screen key. This option should be used on the advice of Ares Technologies personnel to assist in resolving printing problems. -xN Set VGA card type. This option allows owners of ATI VGA boards to use LQVGA. Because the ATI BIOS does not return certain parameters correctly, this option is necessary to print the ATI high-resolution modes. Owners of all other board types should use the default BIOS option. Possible values for N are listed below. 0 - BIOS support. This is the default for LQVGA. 1 - ATI hardware support. This option allows LQVGA to access the ATI hardware directly. -v Suppress new-line character. Some printers will perform an automatic line feed when they receive a carriage- return character. If your printer produces a blank line between every text or graphics line when using LQVGA, then you should use this option. -tN Set printer type. The available printer types are listed below. 0 - Default printer. This printer makes all possible resolutions available to the user. 1 - IBM Graphics printer. 2 - Epson 9-pin printers. This includes the EX, FX, LX, RX and other series printers. 3 - Epson 24-pin printers. This includes the LQ series printers. 4 - Canon Bubble Jet. -q Query available resolutions. This option will display a table of printers and the resolution codes available to them. This table is reproduced below. Column A: IBM Graphics Printer V = 72dpi Column B: Epson 9-pin Printers V = 72dpi Column C: Epson 24-pin Printers V = 60dpi Column D: Canon Bubble Jet V = 60dpi Res. Code Horz. Res. Vert. Res. A B C D 1 60 1 X 2 120 1 X 3 120 (fast) 1 X 4 240 1 X 5 60 3 X 6 120 3 X 7 120 (fast) 3 X 8 240 3 X 9 60 1 X X X 10 120 1 X X X 11 120 (fast) 1 X X X 12 240 1 X X X 13 80 1 X X X 14 72 1 * 15 90 1 X X X 16 144 1 * 17 60 3 X X X 18 120 3 X X X 19 120 (fast) 3 X X X 20 240 3 X X X 21 80 3 X X X 22 72 3 * 23 90 3 X X X 24 144 3 * 25 60 3 X X 26 120 3 X X 27 90 3 X X 28 180 3 X X 29 360 3 X X * Available on some models. Res. Code is the code entered in the -rN option. Horz. Res. is horizontal resolution in dots-per-inch (DPI). Vert. Res. is used to calculate vertical resolution. Multiply this number by the V specified for your particular printer to get vertical resolution in dots-per- inch (DPI). The default V is 60 DPI. EXAMPLES LQVGA Load LQVGA into resident memory using the default options. LQVGA -l2 Load LQVGA into resident memory and redirect output to LPT2:. LQVGA -ol -a4 Load LQVGA into resident memory and choose landscape graphics with Floyd-Steinberg dithering. LQVGA -r29 -n Print the current screen at 360x180 DPI. Do not load LQVGA into resident memory. LQVGA -s1,1 Load LQVGA into resident memory and set the scaling so that each screen pixel is represented by one printer pixel. LQVGA -s0,4 Load LQVGA into resident memory and set the scaling so that each screen pixel is represented by 4 printer pixels down and by an appropriate number of printer pixels across. LQVGA -d Disable a previously loaded copy of LQVGA and return print-screen control to the system BIOS. set LQVGA=-b16 -ol LQVGA Load LQVGA into resident memory and choose landscape graphics with brightness set to 16. set LQVGA=-ol -a4 LQVGA -a0 Load LQVGA into resident memory and choose landscape graphics. Choose Bayer-Dispersed dithering. (The command line option -a0 overrides the environment option -a4.) HOW IT WORKS LQVGA has two primary jobs - printing text and printing graphics. Printing text is straightforward. LQVGA simply reads the text from the screen and sends it to the printer. LQVGA has an advantage over the built-in print screen routines, however, since it knows how to control the laser printer. Thus, LQVGA can set up the printer to print the extended characters such as the line- drawing characters. It can also set up the printer to handle special screen modes such as the 132x60 text modes available on some SuperVGA cards. Printing graphics is where LQVGA is most useful. DOS has only very basic graphics printing capability - and even then this ability is only made available by loading large TSRs. LQVGA solves this shortcoming by providing high-quality printing in a very small package - approximately 8.5k resident. The biggest problem faced by LQVGA is how to produce a recognizable image of the screen, which can have up to 256 colors out of a palette of 262,144 colors, on the printer, which has only 2 colors - black and white. LQVGA solves this problem by a method called dithering. This is a method by which a larger number of colors can be represented by using patterns of dots chosen from a smaller number of colors. In this case, that allows up to 256 colors to be represented by different patterns of only two colors. Actually, colors images cannot be accurately reproduced on a black-and-white printer (obviously!) Therefore, LQVGA actually produces a print that is based on the intensities of the colors on the screen. This is the same as saying that if you were to convert the colors on screen to shades of grey, LQVGA produces an approximation of the shades-of-grey screen. This works because the human eye is more sensitive to certain colors than to others, thus these colors can be approximated by different shades of grey. Thus, by printing areas of dots of varying densities, LQVGA can approximate these grey shades. Printing just a few dots results in bright areas, while printing more dots results in dark areas. LQVGA uses two major varieties of dithering to produce these dot- densities. The first, fastest method is known as ordered or Bayer dithering and uses a predefined pattern to reproduce each color. This pattern contains a set of numbers representing color threshold values. As the image is generated, each screen pixel is compared against the threshold value at the spot in the pattern where that pixel will be plotted. If the pixel color is greater than the threshold value, a dot is printed. Otherwise, no dot is printed. Thus the output image has a regular, ordered appearance, because it is based completely on the original pattern. LQVGA uses two different patterns for this method. The first is a "dispersed" pattern which produces dots in a widely spread pattern. Because of the way this pattern is generated, it produces a characteristic cross-hatched output. The second pattern is a "clustered" pattern. In this pattern, similar threshold values are grouped closely together to produce large dots. This pattern generates an image which appears to be made up of different sized dots, much like the pictures in a newspaper. The second variety of dithering is known as random dithering because it produces dots in a seemingly random manner. This dither is also known as an error-dispersion dither because of the way it produces dots. This method works in two steps. In the first step, the current screen pixel is compared against a predefined threshold value. If the color is greater than the threshold, a dot is printed, otherwise, no dot is printed. The second step compares what is actually printed against what should be printed. This produces an "error" value which is divided up and added to the neighboring screen pixels. This is repeated for every pixel in the image. Thus if a dot is supposed to be dark grey and we plot black, the error value generated reduces the chance that the next pixel plotted will also be black, ensuring that we get an area of "dark grey" on the output. This method is slower than the ordered dithers because of the math involved, but because it is based on the image itself, and not on a predefined pattern, it significantly reduces the chances of incidental patterns ("artifacts") emerging in the final output. There are many variations of random dithering, but LQVGA uses only one of these, the Floyd-Steinberg dither. ADDITIONAL NOTES LQVGA is only guaranteed to work with VGA screen modes that are supported by video BIOS. Most SuperVGA cards have extended BIOS chips which support all of the vendor-defined modes and thus will work with LQVGA. However, some graphics packages such as PICEM and VPIC can directly program VGA cards into modes not supported by BIOS. LQVGA is NOT guaranteed to work with these modes. For the future, we plan to enhance LQVGA to support VGA hardware directly. This will increase its speed and flexibility, and will allow it to print these special modes. If you discover any unsupported modes, please let us know about them and we will consider them when the enhancements are made. REPORTING BUGS If you discover what seems to be a bug in LQVGA, please let us know! If we verify a bug you discover, you will receive a free registered version of the fixed program! CURRENT KNOWN PROBLEMS Only supports video BIOS-supported modes. When using print modes 1 or 2, LQVGA cannot be invoked while a DOS function is active. This is due to an untraceable bug and will be corrected soon. LQVGA RELEASE HISTORY v1.70 (920818) Initial release. (Converted from LJVGA v1.70) TECHNICAL SUPPORT If you have any questions or comments about LQVGA, contact: Mail: Ares Technologies 243 Fairfax Rd. Blacksburg, VA 24060 Phone: 703-552-5983 E-Mail: CIS: 73237,1572 MHS: support @ ares Ares Technologies is also available for custom programming projects. Please feel free to contact us if you would like to discuss your programming needs. REGISTRATION If you find LQVGA useful and convenient, a registration of $10 or more would be appreciated. If you send $20 or more, you will receive a disk containing the current version of the software. You will also receive a disk with the next major version when it becomes available. For a fee of $50, you will receive a lifetime registration for LQVGA. This will entitle you to every major and minor version of LQVGA as they are released. These will be automatically sent to you free of additional charge. Site licenses are available for commercial and multiple user organizations. Please read the file REGISTER.TXT for more information. Reseller information is available for developers wishing to bundle pre-registered versions of LQVGA with their own software. Please contact Ares Technologies directly for more information. Please state the current version of the software you are using. Send check or money order to: Ares Technologies 243 Fairfax Rd. Blacksburg, VA 24060 SOFTWARE LICENSE AGREEMENT LQVGA VGA/Epson Print Screen Utility Copyright (c) 1992 Ares Technologies. All Rights Reserved. Notice: By using LQVGA, you agree to be bound by the terms of this license. If you do not agree with the conditions listed herein, you may not use LQVGA. If you have any questions regarding your software license, please contact Ares Technologies at the address listed elsewhere in this document. You may use, copy, and distribute LQVGA for noncommercial purposes only, provided the following conditions are met: No fees may be charged for use or distribution. The program and accompanying documentation must be distributed in unmodified form. Reverse compilation, reverse engineering, or any other form of code decomposition is expressly prohibited. Clubs, user groups, and shareware distributors may charge a nominal fee for expenses and handling only while distributing LQVGA. Operators of electronic bulletin board systems may charge only normal membership fees, and may not require additional fees for access to LQVGA. Distributors are encouraged to register with Ares Technologies. See the file SYSOP.TXT for additional information. Site and commercial licenses are available for LQVGA. Please read the file REGISTER.TXT, or contact Ares Technologies for more information. Ares Technologies hereby disclaims all warranties relating to this software, express or implied, including without limitation any warranties of merchantability or fitness for a particular application. Ares Technologies will not be liable for any damages, direct, consequential, or otherwise, suffered due to loss of data or any other reason, even if Ares Technologies has been advised of the possibly of such damage. In no event shall Ares Technologies' liability for any such damages exceed the price paid for the license to use the software, regardless of the form of the claim. The user of this software bears all risk as to the quality and performance of the software.