This is a simple example of double buffered video output.
The first buffer, which is the largest one, contains all lines of text printed as a long column.
The second buffer is of size of the output frame. Triggered by each timer event, the program code:
- draws a gradient background ( GradientFill )
- puts some stars ( Polygon )
- copies a rectangle part with text lines from the first buffer ( BitBlt )
After this the second buffer is drawn completely, and it is copied to the output frame on the form with the BitBlt function.
The timing is important for creating a smooth scrolling. Fortunately there are not too many FoxPro commands involved in this cycle, mostly Win32 functions do the job. So the performance is almost the same as it could be for a similar VB code.