home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
551-575
/
apd571
/
progs
/
picinfo
/
pic_info.amos
/
pic_info.amosSourceCode
Wrap
AMOS Source Code
|
1993-12-02
|
22KB
|
725 lines
'==========================================================================
'========================= PIC_INFO PROGRAM ===============================
'=========================== V.C.Anthony ==================================
'============================== Jan'93 ====================================
'==========================================================================
'
Dim PIC$(21) : Rem For storage of picture file data
Dim PIC_PRINT$(21) : Rem For storage of Pic Print data
Dim PIC_COLOR$(64) : Rem Pic Colors in hex. RGB Format
'
'Initial Display Parameters
WDISPLAY=126 : HDISPLAY=44
WODISPLAY=111 : HODISPLAY=27
'
Screen Open 0,640,512,4,Laced+Hires : Flash Off : Curs Off
Screen Display 0,WDISPLAY,HDISPLAY,,
Palette $0,$288,$800,$F
Screen Hide 0
'
SEARCH_PATH$="Sys:"
MAIN_TITLE$="SELECT PIC FILE TO BE LOADED"
BOTTOM_TITLE$="for display and parameter check"
Proc PIC_FILE_SELECT
'
'
'check Pic File for parameters and to put data into pic_print$(18)
Proc PIC_FILE_CHECK
'
Proc PIC_PARAMETERS
'
Proc PIC_SCREEN_DATA
'
Proc PIC_LOAD
'
'Open Pic Title screen
Screen Open 2,640,16,2,LACE+Hires
Screen Display 2,WDISPLAY,HDISPLAY,,
Palette $0,$888
'
Proc PIC_TITLE
'
'SELECTION_LOOP
Repeat
'
'Left Mouse Button pressed
If Mouse Key=1 and PIC=1
Proc PIC_TITLE
'
'N Key pressed to Select new Pic File
Else If Key State(54)
Screen Close 1 : Screen 2 : Cls 0 : Screen To Back 2 : PIC=0
Screen To Front 0 : Screen Hide 0 : Screen 0
GX1=0 : GY1=0 : GX2=0 : GY2=0 : Bell 10
SEARCH_PATH$="Sys:"
MAIN_TITLE$="SELECT PIC FILE TO BE LOADED"
BOTTOM_TITLE$="for display and parameter check"
Proc PIC_FILE_SELECT : Proc PIC_FILE_CHECK
Proc PIC_PARAMETERS : Proc PIC_SCREEN_DATA
Proc PIC_LOAD : Proc PIC_TITLE
Bell 10
'
'SPACE Key pressed To go to PIC Data Screen
Else If Key State(64)
Bell 10
If PIC=1
PIC=0 : Screen To Back 1 : Screen To Back 2
Screen To Front 0 : Screen Show 0 : Curs Off : Bell 10
Screen 0 : Screen Display 0,WDISPLAY,HDISPLAY,, : Rem Any Pic centering ?
Proc PIC_SCREEN_DATA
End If
'
'P Key pressed to print Pic Data
Else If Key State(25)
Bell 10 : Proc PIC_PRINT
'
'V Key pressed to View PIC
Else If Key State(52)
If PIC=0
Bell 10 : Screen Hide 0 : Screen To Front 1 : PIC=1
End If
'
'An Arrow Key is pressed to enable Pic centering inside the View Port
'or to enable scrolling of a large BitMap inside the View Port
Else If Key State(78) or Key State(79) or Key State(76) or Key State(77)
If PIC=1
Bell 10 : Proc ARROW_KEY
End If
'
'T / B Key pressed to set Pic Rectangle for Dump to the printer
Else If Key State(20) or Key State(53)
If PIC=0
Screen Hide 0 : Screen To Front 1 : PIC=1
End If
Screen 1
While Key State(20) or Key State(53)
Proc PIC_RUBBER_BAND
Wend
'
'D Key pressed to Dump Pic Rectangle to Printer
Else If Key State(34)
If PIC=0
Screen Hide 0 : Screen To Front 1 : Screen 1 : PIC=1
End If
Proc PIC_DUMP
'
'S KEY PRESSED To Save PIC
Else If Key State(33)
If PIC=1
Screen To Front 0 : Screen 0
End If
SEARCH_PATH$="Sys:"
MAIN_TITLE$="SELECT / ENTER PIC NAME TO BE SAVED"
BOTTOM_TITLE$="as compressed IFF with display parameters"
Bell 10 : Proc PIC_FILE_SELECT
Screen To Front 1 : Screen 1
'
Save Iff PATH$,1
'
Bell 10
End If
'
'ESC Key pressed to Exit Program
Until Key State(69)
Bell 10 : Screen Close 1 : Screen Close 2 : Screen Close 0
End
'
'
Procedure PIC_FILE_SELECT
Shared PATH$,PIC$(),SEARCH_PATH$,MAIN_TITLE$,BOTTOM_TITLE$
Screen Hide 0 : Curs On : Bell 10
NAME_DEFAULT$=""
PATH$=Fsel$(SEARCH_PATH$,NAME_DEFAULT$,MAIN_TITLE$,BOTTOM_TITLE$)
If PATH$=""
Bell 10 : Screen Close 1 : Screen Close 2 : Screen Close 0
End
End If
Curs Off
End Proc
'
Procedure PIC_FILE_CHECK
Shared PATH$,NAME$,PIC$(),PIC_PRINT$(),WPIC,HPIC,WVIEW,HVIEW,PIC_COLOR,SIZE
'
L=Len(PATH$) : C=L : NAME$="" : C$=""
Repeat
NAME$=C$+NAME$
C$=Mid$(PATH$,C,1)
C=C-1
Until(C$="/") or(C$=":")
'
Rem Open Pic File so as to read parameter data from it
Open In 1,PATH$
For FD=1 To 21
Line Input #1,PIC$(FD)
Next FD
Close 1
'
If PIC$(1)<>"FORM" : Rem File is not IFF
PIC_PRINT$(1)=""
Else
PIC_PRINT$(1)=" FORM"
FD=1
End If
Repeat
FD=FD+1
L=Len(PIC$(FD))
If L=0
PIC_PRINT$(FD)=" -"
Else If L<10
For C=1 To L
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
End If
Until L>9
S1=Asc(Left$(PIC$(FD),1)) : S2=Asc(Mid$(PIC$(FD),2,1)) : S3=Asc(Mid$(PIC$(FD),3,1))
PIC_PRINT$(FD)=Str$(S1)+Str$(S2)
SIZE=S1*256+S2 : C=2
If L>10
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(S3)
SIZE=SIZE*256+S3 : C=3
End If
If Mid$(PIC$(FD),C+1,4)="ILBM"
PIC_PRINT$(FD)=PIC_PRINT$(FD)+" "+Right$(PIC$(FD),8)
End If
If Right$(PIC$(FD),4)<>"BMHD"
Repeat
FD=FD+1
L=Len(PIC$(FD))
If L=0
PIC_PRINT$(FD)=" -"
Else If L<4
PIC_PRINT$(FD)=""
For C=1 To L
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
End If
Until Right$(PIC$(FD),4)="BMHD"
PIC_PRINT$(FD)=""
If L>4
For C=1 To L-4
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
End If
PIC_PRINT$(FD)=PIC_PRINT$(FD)+" BMHD"
End If
Repeat
FD=FD+1
L=Len(PIC$(FD))
If L=0
PIC_PRINT$(FD)=" -"
End If
Until Asc(Left$(PIC$(FD),1))=20
'
PIC_PRINT$(FD)=""
For C=1 To L
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
'
'Evaluate Pic Bit Map Width and Height
'-------------------------------------
If L=2
A=Asc(Right$(PIC$(FD),1))
If A=1 or A=2 or A=3
WPIC=A*256
Else
WPIC=A
End If
Else If L=3
A=Asc(Mid$(PIC$(FD),2,1)) : B=Asc(Right$(PIC$(FD),1))
WPIC=A*256+B
Else If L=4
A=Asc(Mid$(PIC$(FD),2,1)) : B=Asc(Mid$(PIC$(FD),3,1))
C=Asc(Right$(PIC$(FD),1))
WPIC=A*256+B
If C<10
HPIC=C*256
Else
HPIC=C
End If
Goto FINISH_PIC_BITMAP
Else If L>4
A=Asc(Mid$(PIC$(FD),L-3,1)) : B=Asc(Mid$(PIC$(FD),L-2,1))
C=Asc(Mid$(PIC$(FD),L-1,1)) : D=Asc(Right$(PIC$(FD),1))
WPIC=A*256+B
HPIC=C*256+D
Goto FINISH_PIC_BITMAP
End If
'
FD=FD+1
PIC_PRINT$(FD)=""
For C=1 To L
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
L=Len(PIC$(FD))
If L=1
A=Asc(PIC$(FD))
If A=1 or A=2 or A=3
HPIC=A*256
Else
HPIC=A
End If
Else If L>1
A=Asc(Mid$(PIC$(FD),L-1,1)) : B=Asc(Right$(PIC$(FD),1))
HPIC=A*256+B
End If
FINISH_PIC_BITMAP:
'-----------------
'
PIC_COLOR=0
Repeat
FD=FD+1 : L=Len(PIC$(FD))
If L=0
PIC_PRINT$(FD)=" -"
Else If L>0
If PIC_COLOR=0
PIC_COLOR=Asc(Left$(PIC$(FD),1))
End If
If L<4
PIC_PRINT$(FD)=""
For C=1 To L
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
Else If L>3
A$=Right$(PIC$(FD),4)
If(A$<>"CMAP") and(A$<>"CAMG")
PIC_PRINT$(FD)=""
For C=1 To L
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
Else If(A$="CMAP") or(A$="CAMG")
PIC_PRINT$(FD)=""
For C=1 To L-4
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
PIC_PRINT$(FD)=PIC_PRINT$(FD)+" "+A$
'
'Evaluate View Port Width and Height
'-------------------------------------------------------------
If L=4
CHECK=FD-1 : CHAR=0
Else If L=5
A=Asc(Left$(PIC$(FD),1))
If A=200 or A=1 or A=2
If A=200
HVIEW=200
Else If A=1 or A=2
HVIEW=A*256
End If
L=Len(PIC$(FD-1))
WVIEW=Asc(Mid$(PIC$(FD-1),L-1,1))*256+Asc(Right$(PIC$(FD-1),1))
Goto CHECK_FINISH
Else
CHECK=FD-1 : CHAR=0
End If
Else If L>7
CHECK=FD : CHAR=4
End If
L=Len(PIC$(CHECK))
A1=Asc(Mid$(PIC$(CHECK),L-CHAR-3,1)) : A2=Asc(Mid$(PIC$(CHECK),L-CHAR-2,1))
A3=Asc(Mid$(PIC$(CHECK),L-CHAR-1,1)) : A4=Asc(Mid$(PIC$(CHECK),L-CHAR,1))
If A2=1 or A2=2
WVIEW=A2*256+A3
If A4=1 or A4=2
HVIEW=A4*256
Else
HVIEW=A4
End If
Else If A2>2
WVIEW=A1*256+A2
HVIEW=A3*256+A4
End If
CHECK_FINISH:
End If
End If
End If
Until(A$="CMAP") or(A$="CAMG") or(FD=21)
If(A$<>"CMAP") and(FD<21)
Repeat
FD=FD+1 : L=Len(PIC$(FD))
If L=0
PIC_PRINT$(FD)=" -"
Else If L<4
PIC_PRINT$(FD)=""
For C=1 To L
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
Else If L>3
B$=Right$(PIC$(FD),4)
If B$="CMAP"
PIC_PRINT$(FD)=""
For C=1 To L-4
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
PIC_PRINT$(FD)=PIC_PRINT$(FD)+" "+B$
Else
PIC_PRINT$(FD)=""
For C=1 To L
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
End If
End If
Until(B$="CMAP") or(FD=21)
End If
If FD<21
Repeat
FD=FD+1 : L=Len(PIC$(FD))
If L=0
PIC_PRINT$(FD)=" -"
Else If L>0
If L>18
L=18
End If
PIC_PRINT$(FD)=""
For C=1 To L
PIC_PRINT$(FD)=PIC_PRINT$(FD)+Str$(Asc(Mid$(PIC$(FD),C,1)))
Next C
If L=18
PIC_PRINT$(FD)=PIC_PRINT$(FD)+" + MORE"
End If
End If
Until FD=21
End If
End Proc
'
Procedure PIC_PARAMETERS
Shared PIC$,PIC_COLOR,WPIC,HPIC,WVIEW,HVIEW,WRES$,HRES$
Shared OVERSCAN,OVERSCAN$,HAM$
If PIC_COLOR<6
PIC_COLOR=2^PIC_COLOR : HAM$="" : Rem Convert bit planes to no. of colors
Else If PIC_COLOR=6
PIC_COLOR=4096 : HAM$="HAM "
End If
OVERSCAN=0 : OVERSCAN$="" : WRES$="" : HRES$=""
If WVIEW<640
WRES$="LOWRES"
Else If WVIEW>639
WRES$="HIRES"
End If
If HVIEW<512
HRES$="PAL"
If HVIEW=200
HRES$="NTSC"
Else If HVIEW=400
HRES$="LACED NTSC"
End If
Else If HVIEW>511
HRES$="LACED PAL"
End If
PIC$=""
If WPIC=WVIEW and HPIC=HVIEW
If WVIEW=320 or WVIEW=640
If HVIEW=256 or HVIEW=200 or HVIEW=400 or HVIEW=512
OVERSCAN=0 : PIC$="PIC"
End If
Else If WVIEW>320 and WVIEW<353
If HVIEW>256 and HVIEW<284
OVERSCAN=1 : PIC$="PIC"
Else If HVIEW>512 and HVIEW<567
OVERSCAN=1 : PIC$="PIC"
End If
Else If WVIEW>256 and WVIEW<705
If HVIEW>256 and HVIEW<284
OVERSCAN=1 : PIC$="PIC"
Else If HVIEW>512 and HVIEW<567
OVERSCAN=1 : PIC$="PIC"
End If
End If
If PIC$=""
OVERSCAN=2 : PIC$="PIC"
End If
End If
If PIC$=""
If WPIC<WVIEW or HPIC<HVIEW
OVERSCAN=0 : PIC$="BRUSH"
Else If WPIC>WVIEW or HPIC>HVIEW
If WVIEW=320 or WVIEW=640
OVERSCAN=0 : PIC$="BITMAP"
Else
OVERSCAN=1 : PIC$="BITMAP"
End If
End If
End If
If OVERSCAN=1
OVERSCAN$="OVERSCAN"
Else If OVERSCAN=2
OVERSCAN$="MAX OVERSCAN"
Else If OVERSCAN=0
OVERSCAN$=""
End If
'
'
End Proc
'
Procedure PIC_SCREEN_DATA
'Print Pic Data on Screen 0
Shared PIC_PRINT$(),PIC_COLOR$(),PIC_COLOR$,PIC_COLOR,PIC$,WPIC,HPIC
Shared PATH$,WVIEW,HVIEW,SIZE,PIC_COLOR,OVERSCAN$,HAM$,WRES$,HRES$
Shared GX1,GY1,GX2,GY2
If GX2=0 and GY2=0
GX1=0 : GY1=0 : GX2=WVIEW-1 : GY2=HVIEW-1
End If
Screen 0 : Cls 1
Locate 1,1 : Pen 2 : Paper 1 : Print "V = VIEW PIC."
Locate 1,2 : Print "D = DUMP PIC TO PRT"
Locate 1,3 : Print "S = SAVE PIC"
Locate 1,4 : Print "N = NEW PIC"
Locate 65,1 : Print "P = PRINT DATA"
Locate 63,2 : Print "ESC = END PROG."
Locate 61,3 : Print "SPACE = PIC DATA"
Locate 54,4 : Print "T,B + ARROWS = PIC RECT."
Locate 1,6 : Print "IN VIEW MODE PRESSING ARROW KEYS ONLY SCROLLS A LARGE PIC BITMAP ACROSS SCREEN"
Locate 1,8 : Print "IN VIEW MODE SHIFT + ARROW KEYS ENABLE PIC CENTERING INSIDE VIEW PORT"
Pen 3
Locate 1,10 : Print "DUMP RECTANGLE =";(GX2-GX1+1);" *";(GY2-GY1+1);" / TOP LEFT =";GX1;",";GY1;" / BOTTOM RIGHT =";GX2;",";GY2
Pen 2
Locate 1,12 : Print "IN VIEW MODE PRESS T / B KEY TO SIZE TOP LEFT / BOTTOM RIGHT CORNER"
Locate 1,14 : Print "WHILE PRESSING T / B KEY USE ARROW KEYS TO SIZE PIC RECTANGLE FOR PRINTER DUMP"
Locate 30,1 : Print "PIC_INFO DATA SCREEN"
Locate 30,2 : Print "--------------------"
Locate 31,3 : Pen 0 : Print "V.C.Anthony Jan'93"
Locate 1,16 : Print PATH$;" = ";WRES$;" ";OVERSCAN$;" ";HRES$
Locate 1,18 : Print PIC$;" =";WPIC;" *";HPIC;" View Port =";WVIEW;" *";HVIEW;" / ";HAM$;PIC_COLOR;" COLORS";" /";SIZE;" Bytes"
Locate 1,21 : Print "COMPUTER ENHANCED FIRST 21 PIC FILE DATA LINES"
Locate 1,22 : Print "----------------------------------------------"
For FD=1 To 21
Locate 0,FD+22 : Print PIC_PRINT$(FD)
Next FD
If PIC_COLOR<4096
Print : Print " COLOR VALUES IN HEX. RGB FORMAT"
Print " -------------------------------"
For C=0 To PIC_COLOR-1
Print " COLOR";C;" = ";PIC_COLOR$(C);
If((C+1)/4)*4=C+1
Print
Else
Print " , ";
End If
Next C
End If
End Proc
'
Procedure PIC_LOAD
Shared PATH$,PIC_COLOR$(),PIC_COLOR$,PIC_COLOR,OVERSCAN,WVIEW,HVIEW,PIC
Shared WDISPLAY,HDISPLAY,WODISPLAY,HODISPLAY,PIC$,PIC_NOSCAN,PIC_OVERSCAN
Shared HAM$
Curs Off
'
Load Iff PATH$,1 : PIC=1 : Rem Load pic and open Screen 1
'
'Position Screen View Port (Centre Pic)
If OVERSCAN=0
Screen Display 1,WDISPLAY,HDISPLAY,WVIEW,HVIEW
Else If OVERSCAN>0
Screen Display 1,WODISPLAY,HODISPLAY,WVIEW,HVIEW
End If
'
'Evaluate Pic Colors in hex values
Screen 1
If PIC_COLOR=4096
PIC_COLOR=Screen Colour : Rem to correct if necessary for half bright
If PIC_COLOR<65
HAM$=""
End If
End If
If PIC_COLOR<65
PIC_COLOR$="YES"
For C=0 To PIC_COLOR-1
PIC_COLOR$(C)=Hex$(Colour(C),3)
Next C
Else
PIC_COLOR$=""
End If
End Proc
'
Procedure PIC_TITLE
Shared PATH$,NAME$,PIC_COLOR$,PIC_COLOR$(),PIC_COLOR,PIC,WPIC,HPIC,WVIEW,HVIEW
Shared OVERSCAN,OVERSCAN$,HAM$,PIC$,WRES$,HRES$,WDISPLAY,HDISPLAY
Screen To Front 2 : Screen 2 : Bell 10
Screen Display 2,WDISPLAY,HDISPLAY,, : Rem Any Pic centering ?
Curs Off : Cls 1 : Pen 0 : Paper 1
Locate 0,0 : Centre "ESC=END;SPACE=PIC DATA;P=PRINT;DATA;V=VIEW PIC;D=DUMP PIC;S=SAVE PIC;N=NEW PIC"
Locate 0,1 : Centre Left$(NAME$,16)+Str$(WPIC)+" *"+Str$(HPIC)+" VIEW ="+Str$(WVIEW)+" *"+Str$(HVIEW)+" "+OVERSCAN$+Str$(PIC_COLOR)+" COL "+WRES$+" "+HRES$
While Mouse Key=1
Wend
Screen To Front 1 : Screen 1 : Bell 10
End Proc
'
Procedure PIC_PRINT
Shared PIC_PRINT$(),PIC_COLOR$(),PIC_COLOR,PIC$,SIZE,WVIEW,HVIEW
Shared PATH$,PIC$,WRES$,HRES$,HAM$,PIC_COLOR$,WPIC,HPIC,GX1,GY1,GX2,GY2
Lprint " V = VIEW PIC PIC_INFO PROGRAM N = NEW PIC"
Lprint " P = DUMP PIC RECT. ---------------- P = PRINT PIC DATA"
Lprint " S = SAVE PIC V.C.Anthony Jan'93 ESC = END PROG."
Lprint " SPACE = PIC DATA T,B + ARROWS = PIC RECT."
Lprint
Lprint " "+PATH$;" = ";WRES$;" ";OVERSCAN$;" "+HRES$
Lprint
Lprint " ";PIC$;" =";WPIC;" *";HPIC;" / View Port =";WVIEW;" *";HVIEW;" / ";HAM$;PIC_COLOR;" COLORS";" / File =";SIZE;" Bytes"
Lprint
Lprint "IN VIEW MODE PRESSING ARROW KEYS SCROLLS A LARGE PIC BITMAP ACROSS VIEW PORT"
Lprint "IN VIEW MODE PRESSING SHIFT + ARROW KEYS CENTERS PIC ON SCREEN"
Lprint
Lprint "DUMP RECTANGLE =";(GX2-GX1+1);" *";(GY2-GY1+1);" / TOP LEFT =";GX1;",";GY1;" / BOTTOM RIGHT =";GX2;",";GY2
Lprint
Lprint "IN VIEW PIC MODE PRESS T / B KEYS TO SIZE TOP LEFT / BOTTOM RIGHT CORNER"
Lprint "WHILE PRESSING T / B KEYS USE ARROW KEYS TO SIZE PIC RECTANGLE FOR PRINTER DUMP"
Lprint
Lprint " COMPUTER ENHANCED FIRST 21 PIC FILE DATA LINES"
Lprint " ----------------------------------------------"
For FD=1 To 21
Lprint PIC_PRINT$(FD)
Next FD
Lprint
If PIC_COLOR<65
Lprint " PIC COLOUR VALUES IN HEX. RGB FORMAT"
Lprint " ------------------------------------"
For C=0 To PIC_COLOR-1
Lprint " ";"COLOR";C;" = ";PIC_COLOR$(C);
If((C+1)/4)*4=C+1
Lprint
Else
Lprint " /";
End If
Next C
End If
Lprint Chr$(12) : Rem Form Feed
End Proc
'
Procedure ARROW_KEY
Shared WDISPLAY,HDISPLAY,WODISPLAY,HODISPLAY,PIC$,WPIC,HPIC,WOFFSET,HOFFSET
Shared WVIEW,HVIEW,OVERSCAN
W=0 : H=0
If Key State(78) : Rem Right Arrow Key
W=1
Else If Key State(79) : Rem Left Arrow Key
W=-1
Else If Key State(76) : Rem Up Arrow Key
H=-1
Else If Key State(77) : Rem Down Arrow
H=1
End If
'
'Shift Key is not pressed for Scrolling a large BitMap across View Port
If PIC$="BITMAP" and Key Shift=0
WOFFSET=WOFFSET+W : HOFFSET=HOFFSET+H
If WOFFSET<0
WOFFSET=0
Else If WOFFSET>WPIC-WVIEW
WOFFSET=WPIC-WVIEW
End If
If HOFFSET<0
HOFFSET=0
Else If HOFFSET>HPIC-HVIEW
HOFFSET=HPIC-HVIEW
End If
Screen Offset 1,WOFFSET,HOFFSET
'
'Left Shift Key pressed to select centering Pic inside View Port
Else If Key Shift=1
If OVERSCAN=0
WDISPLAY=WDISPLAY+W*16 : HDISPLAY=HDISPLAY+H
Screen 1 : Screen Display 1,WDISPLAY,HDISPLAY,WVIEW,HVIEW
Else If OVERSCAN>0
WODISPLAY=WODISPLAY+W*16 : HODISPLAY=HODISPLAY+H
Screen Display 1,WODISPLAY,HODISPLAY,WVIEW,HVIEW
End If
Wait 25
End If
End Proc
'
'
Procedure PIC_RUBBER_BAND
Shared WVIEW,HVIEW,GX1,GY1,GX2,GY2
Pen 1 : Paper 0 : Curs Off
If GX2=0 and GY2=0
GX1=0 : GY1=0
GX2=WVIEW-1 : GY2=HVIEW-1
End If
Screen To Front 2 : Screen 2 : Cls 1 : Gr Writing 1
PIC_WIDTH=GX2-GX1+1 : PIC_HEIGHT=GY2-GY1+1
T1$="DUMP RECTANGLE : LEFT TOP ="+Str$(GX1)+","+Str$(GY1)+" / RIGHT BOTTOM ="+Str$(GX2)+","+Str$(GY2)
T2$=Space$(16)+"WIDTH ="+Str$(PIC_WIDTH)+" PIXELS / HEIGHT ="+Str$(PIC_HEIGHT)+" PIXELS"
Locate 0,0 : Centre T1$
Locate 0,1 : Centre T2$
Repeat
If Key State(20)=False and Key State(53)=False
Exit
End If
Until Key State(76) or Key State(77) or Key State(78) or Key State(79)
PRESSED_KEY=0
While Key State(76) or Key State(77) or Key State(78) or Key State(79)
If PRESSED_KEY=0
Screen To Front 1 : Screen 1 : Gr Writing 2 : Rem XOR Writing Mode
PRESSED_KEY=1 : Bell 10
End If
If Key State(20) : Rem Key T pressed - Left Corner adjustment
If Key State(78)
GX1=GX1+1
Else If Key State(79)
GX1=GX1-1
If GX1<0
GX1=0
End If
Else If Key State(77)
GY1=GY1+1
Else If Key State(76)
GY1=GY1-1
If GY1<0
GY1=0
End If
End If
Else If Key State(53)
If Key State(78)
GX2=GX2+1
If GX2>WVIEW-1
GX2=WVIEW-1
End If
Else If Key State(79)
GX2=GX2-1
Else If Key State(77)
GY2=GY2+1
If GY2>HVIEW-1
GY2=HVIEW-1
End If
Else If Key State(76)
GY2=GY2-1
End If
End If
Box GX1,GY1 To GX2,GY2
Wait 2
Box GX1,GY1 To GX2,GY2
Wend
Screen To Front 1 : Screen 1
Gr Writing 1 : MK=0 : MZ=0 : Clear Key : Bell 10
Bell 10
End Proc
'
Procedure PIC_DUMP
Shared GX1,GY1,GX2,GY2
Printer Open
'
'Loop until printer is online ready for use or ESC Key pressed to Abort
K$=""
Repeat
Bell 10 : Wait 50
K$=Inkey$
If K$=Chr$(27)
Exit
End If
Until Printer Online
If K$=Chr$(27)
Goto FINISH_PIC_DUMP
End If
K$=""
'
Printer Dump GX1,GY1 To GX2,GY2
'
'Loop while Printer is busy - pic screen must stay in place during Dump
Repeat
Until Printer Check
'
FINISH_PIC_DUMP:
Printer Close : Bell 10
End Proc
'