home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turbo Toolbox
/
Turbo_Toolbox.iso
/
1990
/
06
/
titel
/
plot.bas
< prev
next >
Wrap
BASIC Source File
|
1990-03-05
|
6KB
|
255 lines
'* ------------------------------------------------------- *
'* PLOT.BAS *
'* Bibliothek für High-Level und Low-Level Plotterroutinen *
'* (c) 1990 Wolfhard Rinke & TOOLBOX *
'* ------------------------------------------------------- *
DECLARE SUB PCircle (xm%, ym%, r%)
DECLARE SUB PPSet (x%, y%, col%)
DECLARE SUB PClose ()
DECLARE SUB PFillBox (x1%, y1%, x2%, y2%)
DECLARE SUB PSymbolMode (c$)
DECLARE SUB PAbsoluteDirection (r%, rise%)
DECLARE SUB PArcAbsolute (x%, y%, center%)
DECLARE SUB PArcRelative (x%, y%, center%)
DECLARE SUB PCharPlot (hor%, ver%)
DECLARE SUB PCharSet (n%)
DECLARE SUB PFilltype (typ%, space%)
DECLARE SUB PLineType (typ%, length%)
DECLARE SUB PPlotrelative (x%, y%)
DECLARE SUB PPrint (s$)
DECLARE SUB PRectangleAbsolute (x%, y%)
DECLARE SUB PRectangleRelative (x%, y%)
DECLARE SUB PScale (xmin%, ymin%, xmax%, ymax%)
DECLARE SUB PScalingPoint (x1%, y1%, x2%, y2%)
DECLARE SUB PSegment (r%, start%, center%)
DECLARE SUB PShadeRectAbsolute (x%, y%)
DECLARE SUB PShadeRectRelative (x%, y%)
DECLARE SUB PTextSize (wid!, size!, slant!)
DECLARE SUB PWindow (x1%, y1%, x2%, y2%)
DECLARE SUB PShadeSector (r%, start%, center%)
DECLARE SUB PInit ()
DECLARE SUB PPenDown ()
DECLARE SUB PPenUp ()
DECLARE SUB PGetPen (col%)
DECLARE SUB PMove (x%, y%)
DECLARE SUB PLine (x1%, y1%, x2%, y2%)
DECLARE SUB PColor (col%)
DECLARE SUB PBox (x1%, y1%, x2%, y2%)
'$INCLUDE: 'REGISTER.INC' : REM Für spätere Fehlerbehandlung
CONST MaxX% = 7400, MaxY% = 10300 : '* Sekonic SPL 450
CONST Black% = 1, Red% = 2, Orange% = 3, Brown% = 4
CONST Blue% = 5, Magenta% = 6, Green% = 7, Yellow% = 8
'* ------ ganz kurze Demo -------------------------------- *
PInit
PColor Black%
PFilltype 5, 100
PFillBox 2200, 2200, 3200, 3200
PBox 0, 0, MaxX%, MaxY%
PPSet MaxX% \ 2, MaxY% \ 2, Red%
PCircle MaxX% \ 2, MaxY% \ 2, 300
PPlotrelative 0, 400
PPrint "Toolbox - was sonst?"
PMove 2000, 8000
PSegment 1000, 90, 325
PMove 4000, 8000
PFilltype 1, 50
PShadeSector 1000, 70, 290
PClose
END
'* ------------------------------------------------------- *
SUB PAbsoluteDirection (r%, rise%)
r$ = STR$(r%)
rise$ = STR$(rise%)
LPRINT "DI" + r$ + "," + rise$ + ";"
END SUB
SUB PArcAbsolute (x%, y%, center%)
x$ = STR$(x%)
y$ = STR$(y%)
center$ = STR$(center%)
LPRINT "AA" + x$ + "," + y$ + "," + center$ + ";"
END SUB
SUB PArcRelative (x%, y%, center%)
x$ = STR$(x%)
y$ = STR$(y%)
center$ = STR$(center%)
LPRINT "AR" + x$ + "," + y$ + "," + center$ + ";"
END SUB
SUB PBox (x1%, y1%, x2%, y2%)
PLine x1%, y1%, x2%, y1%
PLine x2%, y1%, x2%, y2%
PLine x2%, y2%, x1%, y2%
PLine x1%, y2%, x1%, y1%
END SUB
SUB PCharPlot (hor%, ver%)
hor$ = STR$(hor%)
ver$ = STR$(ver%)
LPRINT "CP" + hor$ + "," + ver$ + ";"
END SUB
SUB PCharSet (n%)
LPRINT "CA" + STR$(n%) + ";"
END SUB
SUB PCircle (xm%, ym%, r%)
r$ = STR$(r%)
PPenUp
PMove xm%, ym%
LPRINT "CI" + r$
PPenUp
END SUB
SUB PClose
PGetPen 0
PPenUp
PMove 0, 0
END SUB
SUB PColor (col%)
PGetPen col%
END SUB
SUB PFillBox (x1%, y1%, x2%, y2%)
PPenUp
PMove x1%, y1%
PShadeRectAbsolute x2%, y2%
PPenUp
END SUB
SUB PFilltype (typ%, space%)
typ$ = STR$(typ%)
spc$ = STR$(space%)
LPRINT "FT" + typ$ + "," + spc$ + ";"
END SUB
SUB PGetPen (col%)
LPRINT "SP" + STR$(col%) + ";"
END SUB
SUB PInit
LPRINT "IN;DF;PA0,0;"
END SUB
SUB PLine (x1%, y1%, x2%, y2%)
PMove x1%, y1%
PPenDown
PMove x2%, y2%
PPenUp
END SUB
SUB PLineType (typ%, length%)
typ$ = STR$(typ%): length$ = STR$(length%)
LPRINT "LT" + typ$ + "," + length$ + ";"
END SUB
SUB PMove (x%, y%)
x$ = STR$(x%)
y$ = STR$(y%)
LPRINT "PA" + x$ + "," + y$ + ";"
END SUB
SUB PPenDown
LPRINT "PD;"
END SUB
SUB PPenUp
LPRINT "PU;"
END SUB
SUB PPlotrelative (x%, y%)
x$ = STR$(x%): y$ = STR$(y%)
LPRINT "PR" + x$ + "," + y$ + ";"
END SUB
SUB PPrint (s$)
LPRINT "LB" + s$ + CHR$(3) + ";"
END SUB
SUB PPSet (x%, y%, col%)
PPenUp
PGetPen col%
PMove x%, y%
PPenDown
PPenUp
END SUB
SUB PRectangleAbsolute (x%, y%)
x$ = STR$(x%)
y$ = STR$(y%)
LPRINT "EA" + x$ + "," + y$ + ";"
END SUB
SUB PRectangleRelative (x%, y%)
x$ = STR$(x%)
y$ = STR$(y%)
LPRINT "ER" + x$ + "," + y$ + ";"
END SUB
SUB PRelativeDirection (r%, rise%)
r$ = STR$(r%)
rise$ = STR$(rise%)
LPRINT "DR" + r$ + "," + rise$ + ";"
END SUB
SUB PScale (xmin%, ymin%, xmax%, ymax%)
xmin$ = STR$(xmin%) + ",": ymin$ = STR$(ymin%) + ","
xmax$ = STR$(xmax%) + ",": ymax$ = STR$(ymax%) + ","
LPRINT "SC" + xmin$ + ymin$ + xmax$ + ymanx$ + ";"
END SUB
SUB PScalingPoint (x1%, y1%, x2%, y2%)
x1$ = STR$(x1%) + ",": y1$ = STR$(y1%) + ","
x2$ = STR$(x2%) + ",": y2$ = STR$(y2%)
LPRINT "IP" + x1$ + y2$ + x2$ + y2$ + ";"
END SUB
SUB PSegment (r%, start%, center%)
r$ = STR$(r%)
start$ = STR$(start%)
center$ = STR$(center%)
LPRINT "EW" + r$ + "," + start$ + "," + center$ + ";"
END SUB
SUB PShadeRectAbsolute (x%, y%)
x$ = STR$(x%): y$ = STR$(y%)
LPRINT "RA" + x$ + "," + y$ + ";"
END SUB
SUB PShadeRectRelative (x%, y%)
x$ = STR$(x%): y$ = STR$(y%)
LPRINT "RR" + x$ + "," + y$ + ";"
END SUB
SUB PShadeSector (r%, start%, center%)
r$ = STR$(r%) + ","
start$ = STR$(start%): center$ = STR$(center%)
LPRINT "WG" + r$ + start$ + "," + center$ + ";"
END SUB
SUB PSymbolMode (c$)
LPRINT "SM" + c$ + ";"
END SUB
SUB PTextSize (wid!, size!, slant!)
wid$ = STR$(wid!): size$ = STR$(size!)
slant$ = STR$(slant!)
LPRINT "SI" + wid$ + "," + size$ + ";"
LPRINT "SL" + slant$ + ";"
END SUB
SUB PWindow (x1%, y1%, x2%, y2%)
x1$ = STR$(x1%) + ",": y1$ = STR$(y1%) + ","
x2$ = STR$(x2%) + ",": y2$ = STR$(y2%)
LPRINT "IW" + x1$ + y1$ + x2$ + y2$ + ";"
END SUB
'* ------------------------------------------------------- *
'* Ende von PLOT.BAS *