Topic: APLX Help : System Classes : Methods : Draw
[ Previous | Next | Contents | Index | APL Home ]

The 'Draw' method

Argument: Nested array
Result: Depends on operation

Valid for: All visible controls and the Image and Printer objects

The Draw method allows you to draw text, lines, patterns, pictures and geometric shapes on windows, controls, charts, images and printer pages. It takes an argument which comprises one or more phrases which each start with a keyword indicating the operation to perform, followed by the arguments to that operation.

As well as drawing on the screen or printer, it can also be used to draw on an off-screen bitmap using an Image object. This can then be saved in many different formats, such as JPEG, GIF, PDF, BMP, and PNG. In addition, the Draw method can be used in conjunction with the Chart object to add extra graphics elements to charts.

Drawing takes place using a current Pen (for foreground drawing) and Brush (for background drawing). You can also set the Mode which determines how drawing interacts with what is already on the screen.

APLX automatically handles window refreshing for you if the window is uncovered or resized (you can switch this off using the autoredraw property). It does this by storing the sequence of Draw commands applicable to the window or control, and replaying them when an update is required. You can also group a series of commands together, and selectively enable or disable them (for example, to temporarily hide the labels on a graph), or delete them altogether from the saved sequence. This is useful for animation effects.

The general syntax of the Draw method is:

      Control.Draw '<Keyword>' Arg1 Arg2...

where Control is usually the Window into which you want to draw, or a Printer, Image, Chart, Frame or Picture control.

You can also supply multiple sequences of commands on one line:

      Control.Draw ('<Keyword1>' Arg1)  ('<Keyword2>' Arg1 Arg2)...

See the separate section on Using the Draw method for full details.

Topic: APLX Help : System Classes : Methods : Draw
[ Previous | Next | Contents | Index | APL Home ]