Code:
#COMPILE EXE #DIM ALL FUNCTION PBMAIN () AS LONG LOCAL hwina, hwTempBMP AS DWORD LOCAL skey AS STRING ' create a GW and fill it with a hatch pattern GRAPHIC WINDOW "", 200, 200, 400, 400 TO hwina GRAPHIC ATTACH hwina, 0 GRAPHIC BOX (0,0) - (400,400), 0, -1, 0, 4 skey = "" ' create a temporary GW just big enough to hold the area to be copied ' but invisible GRAPHIC BITMAP NEW 50, 50 TO hwTempBMP GRAPHIC ATTACH hwTempBMP, 0 ' copy the area to the smaller GW GRAPHIC COPY hwina, 0, (0,0) - (50, 50) TO (0, 0) ' reconnect to the big GW GRAPHIC ATTACH hwina, 0 ' reverse the hatching so the copied area will show up GRAPHIC BOX (0,0) - (400,400), 0, -1, 0, 3 ' copy it GRAPHIC COPY hwTempBMP, 0, (0,0) - (50, 50) TO (300, 300) ' delete the smaller GW GRAPHIC ATTACH hwTempBMP, 0 GRAPHIC BITMAP END WHILE skey <> $ESC GRAPHIC INKEY$ TO skey WEND END FUNCTION
Leave a comment: