Class TForm1 (unit GrayForm) |
TForm
Simple demonstration of Windows palettes. Copyright © 1998 Tempest Software, Inc. This program displays a gray scale gradation. It shows the basic principles of creating and using Windows palettes in Delphi.
Constructors |
Functions |
Tell Windows not to erase the background because the OnPaint handler will completely cover the form.
Properties |
Events |
Variables |
Constructors |
Functions |
Always restore the old palette
Free the palette.
When the form changes size, make sure to repaint the entire window. Otherwise, only the expanded part gets redrawn, and the gradation looks wrong.
Tell Delphi about the form's palette. Delphi will automatically select and realize the palette when Windows requires it.
Handle of the gray scale palette
Tell Windows not to erase the background because the OnPaint handler will completely cover the form. This reduces the amount of flicker when repainting.
Properties |
Events |
Variables |
Number of distinct gray shades