home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pctchnqs
/
1991
/
number5
/
direct.bas
< prev
next >
Wrap
BASIC Source File
|
1991-09-08
|
1KB
|
43 lines
Sub Command1_Click () ' "PRINT DIRECTLY" BUTTON
' Uses Visual BASIC commands to plot circles and
' lines directly on the printer.
Screen.MousePointer = 11 ' HOURGLASS CURSOR
printer.ScaleMode = 5 ' SCALE IN INCHES
Picture1.Cls
Picture1.Print "Plotting on printer..."
printer.DrawWidth = 3 ' DRAW CIRCLES
printer.Circle (2, 2), 1.5
printer.DrawWidth = 1
printer.Circle (2, 2), 1.45
printer.DrawWidth = 1 ' DRAW LISSAJOUS FIGURE
Pi# = 3.1415926537
x = 2
y = 2 + 1
printer.PSet (x, y)
For t# = 0 To Pi# * 32.1 Step Pi# / 64
x = 2 + Sin(t#)
y = 2 + Cos(t# * 1.0625)
printer.Line -(x, y)
s% = DoEvents()
Next t#
m$ = "PC Techniques" ' PRINT LABEL
printer.CurrentY = 3.05
printer.CurrentX = 2 - printer.TextWidth(m$) / 2
printer.Print m$
Picture1.Print "Spooling output..."
printer.EndDoc ' CLOSE PRINTER
Picture1.Print "Finished"
Screen.MousePointer = 0 ' NORMAL CURSOR
End Sub