Example: Changing the Display Settings

The Display example shows how to set the desktop size to 800x600 and restore the original settings on exit. It creates an 800x600 virtual buffer and fills it with blue pixels. Display uses an 800x600 borderless window to achieve a full screen display, meaning the display is the same size as the virtual buffer. This lets us display the virtual buffer contents with fg_vbpaste() instead of fg_vbscale() and eliminates the need for a WM_SIZE event handler.

Another issue we must address is how to exit the program. Since Display uses a borderless window, we don't have the usual system menu box for this purpose. We'll add a keystroke event handler that gets called on any keypress. This handler will recognize the Esc or F12 keys as program exit keys.

C/C++ version

C++Builder version

Delphi version

Visual Basic version

<< Prev

Next >>

Fastgraph Home Page


copyright 2001 Ted Gruber Software, Inc.