PROGRAM BlockToSecondWindow
?
?   Program Demonstrates F-Basic BLOCK Functions For
?   Capturing Image Data And Moving It To Different Locations
?   In A Different Output Window Residing In A Custom Screen.
?   Draws And Replicates 3 Different Objects
?
INTEGER I,J,K,L,W1,W2,W3,S1

W1=WINDOW #1(0,0,640,200,0,0,0,0,-1,-1,31,@"WINDOW1",-1)
CURS_INV

? Create And Capture First Image

COLOR_BOXFILL #3 (0,30,30,70,70)
COLOR_BOX #2 (0,30,30,70,70)
COLOR_LINE #2 (3,0,0,40,40)
COLOR_LINE #2 (0,70,30,30,70)
I=BLOCK_GET #1 (0,30,30,70,70)

? Redisplay First Image

S1=SCREEN #1(0,200,3,2,@"Custom Screen #1")
W2=WINDOW #18(50,20,540,160,0,0,0,0,-1,-1,31,@"WINDOW18",1)

FOR K=0 TO 1
   FOR I=0 TO 4
      J=BLOCK_PUT #1 (30+I*100,30+K*50,C0'16)
   NEXT I
NEXT K

? Create And Capture Second Image

WINDOW_OUTPUT #1
COLOR_ELLIPSE #1 (100,75,10,10)
COLOR_BOX #3 (0,85,60,115,90)
I=BLOCK_GET #2 (0,85,60,115,90)

? Redisplay Second Image

WINDOW_OUTPUT #18
FOR K=0 TO 2
   FOR I=0 TO 3
      J=BLOCK_PUT #2 (85+I*100,10+K*50,C0'16)
   NEXT I
NEXT K

? Create And Capture Third Image

WINDOW_OUTPUT #1
COLOR_BOXFILL #2 (0,95,45,105,55)
I=BLOCK_GET #20 (0,95,45,105,55)

? Redisplay Third Image

WINDOW_OUTPUT #18
FOR K=0 TO 1
   FOR I=0 TO 3
      J=BLOCK_PUT #20 (95+I*100,45+K*50,C0'16)
   NEXT I
NEXT K

DELAY(100)
BLOCK_CLOSE #1
BLOCK_CLOSE #2
BLOCK_CLOSE #20
WINDOW_CLOSE #1
WINDOW_CLOSE #18
SCREEN_CLOSE #1
END
