Purpose |
Select the graphic target (window
or
|
Syntax |
GRAPHIC ATTACH hWin, id [, REDRAW] |
Remarks |
This statement chooses a graphic target. All further graphic operations will be directed to this target until another GRAPHIC ATTACH or GRAPHIC DETACH statement is executed, or the graphic target is deleted. All PowerBASIC graphical displays are persistent -- they will be automatically redrawn even if minimized or temporarily covered by another window. By default, all graphic operations are displayed immediately upon execution of a graphic statement. In many cases, this is a good choice, because the display is always up-to-date. However, as the complexity of graphic operations increases, this continuous update process does not afford the best performance. It is usually better to use the REDRAW option described below, as it will generally provide a dramatic improvement in overall performance. |
hWin |
Handle of the GRAPHIC WINDOW or
BITMAP to be used with
|
id |
Reserved for future implementation. Must be zero (0). |
REDRAW |
This option can provide a dramatic improvment in the execution speed of graphic statements, as it eliminates repetitive udates to the display. If this option is included, all drawing statements are buffered until a GRAPHIC REDRAW statement is executed, or the operating system chooses to update the target window. Without REDRAW, all graphical statements (Line, Box, Print, etc.) are performed immediately. However, in most cases, it's better to defer the display until a number of statements have been performed. |
Example |
' Draw a blue gradient fill. |
See also |
GRAPHIC BITMAP LOAD, GRAPHIC BITMAP NEW, GRAPHIC DETACH, GRAPHIC WINDOW |