LPRINT is for wimps. It’s old fashioned and included for backwards compatibility. It isn't how printing should be accomplished in a GUI environment.
Now don’t misunderstand, LPRINT is useful and combined with DUMP it lets you mimic old style teletype printing in the mainwin environment, but it has limitations. You can’t mix text and graphics, you can only LPRINT one font style and colour. It is great for program listing, printing line by line program input and output or perhaps combining TAB and fixed width fonts for structured, printed tables.
However, for anything really fancy, you need to use a graphics control, either a graphics window or a graphicbox.
A Better Way
So, leave behind the teletype. In so doing you need to imagine another canvas. Right now you probably imagine the screen, or the graphics control you see on that screen, as a canvas. When you think about printing, you have a second canvas available, it is the printed paper. Both of these canvases exist side by side and each has their own resolution.
By that I mean the graphics control will have a screen pixel width and the printer will have a printed pixel width. A screen might have anything between 800 to 1920 pixels width wise, a printer may have 1984 printed pixels.
==
==Scale
Always the displayed image is scaled to the printed image.
What scale?
So how do we control this scaling? Since the printed resolution is not tied to the screen resolution we can choose.
#win.graphicbox "print"
Liberty BASIC 4.04 allows the programmer to specify how the current screen graphics will be scaled to the printed page. The choices are
• none
• VGA
• SVGA
• XGA
• Custom Pixel Width (expressed as a number)
We can print raw pixels simply by issuing a print command with no size specification. This allows the highest resolution of the printer to be shown. If we draw a few pixels we print a few (tiny) pixels. If we draw many pixels we see more, drawing 1984 pixels wide will in effect fill the width of the printed page, pixel perfect.
==Changing the Resolution]]
We can print scaled pixels by specifying a size. What Liberty BASIC will do is take the width of the printed page (1984 pixels) and spread the specified display pixel SIZE across printed page.
• VGA 640
• SVGA 800
• XGA 1024
Alternatively you can specify the number of pixels that will fill the printed page width by specifying a pixel size.
#win.graphicbox"print 900"
Draw and Print more than you can see
A graphicbox or graphic window control is actually a viewport on a large canvas. You may draw widely on that canvas and see only a portion of it in the graphics control. You may scroll that view.
From a printing perspective the whole of the canvas is in view. Even from a tiny 400x300 graphics viewport you may draw and print full width graphics that fill the printed page.
Another Look at Hard Copy Printing
-Table of Contents
LPRINT Limitations
LPRINT is for wimps. It’s old fashioned and included for backwards compatibility. It isn't how printing should be accomplished in a GUI environment.Now don’t misunderstand, LPRINT is useful and combined with DUMP it lets you mimic old style teletype printing in the mainwin environment, but it has limitations. You can’t mix text and graphics, you can only LPRINT one font style and colour. It is great for program listing, printing line by line program input and output or perhaps combining TAB and fixed width fonts for structured, printed tables.
However, for anything really fancy, you need to use a graphics control, either a graphics window or a graphicbox.
A Better Way
So, leave behind the teletype. In so doing you need to imagine another canvas. Right now you probably imagine the screen, or the graphics control you see on that screen, as a canvas. When you think about printing, you have a second canvas available, it is the printed paper. Both of these canvases exist side by side and each has their own resolution.By that I mean the graphics control will have a screen pixel width and the printer will have a printed pixel width. A screen might have anything between 800 to 1920 pixels width wise, a printer may have 1984 printed pixels.
==
==Scale
Always the displayed image is scaled to the printed image.
What scale?
So how do we control this scaling? Since the printed resolution is not tied to the screen resolution we can choose.
#win.graphicbox "print"
Liberty BASIC 4.04 allows the programmer to specify how the current screen graphics will be scaled to the printed page. The choices are
• none
• VGA
• SVGA
• XGA
• Custom Pixel Width (expressed as a number)
We can print raw pixels simply by issuing a print command with no size specification. This allows the highest resolution of the printer to be shown. If we draw a few pixels we print a few (tiny) pixels. If we draw many pixels we see more, drawing 1984 pixels wide will in effect fill the width of the printed page, pixel perfect.
==Changing the Resolution]]
We can print scaled pixels by specifying a size. What Liberty BASIC will do is take the width of the printed page (1984 pixels) and spread the specified display pixel SIZE across printed page.
• VGA 640
• SVGA 800
• XGA 1024
Alternatively you can specify the number of pixels that will fill the printed page width by specifying a pixel size.
Draw and Print more than you can see
A graphicbox or graphic window control is actually a viewport on a large canvas. You may draw widely on that canvas and see only a portion of it in the graphics control. You may scroll that view.
From a printing perspective the whole of the canvas is in view. Even from a tiny 400x300 graphics viewport you may draw and print full width graphics that fill the printed page.