Drawing in a desktop window can be performed efficiently in BASIC when the Drawfile module is used
You can download the application from here.
- Create a drawing application as before except place the work-area origin at the lower left-hand corner of the window
- Add the initial event-handler
SYS "OS_File",20,file$ TO ,,,,length%
DIM drawfile length%
The procedure LoadFile loads a file named “DrawFile” - stored in the top level of the application's directory - into memory
- Add the Redraw event handler
The procedure Utils_RedrawDrawfile is an AppBasic utility which draws the current sub-rectangle required by the DealWith_WindowRedraw handler. This utility takes care of scaling etc. and calls the SWI DrawFile_Render for you. It is very efficient, allowing BASIC programs to display complex drawings on the desktop without too great a time penalty.