[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
xBase Windows colors management
--------------------------------------------------------------------------------
Windows greatly enhances the drawing and painting capabilities of our
applications as it takes great advantage of working in a graphical
environment.
Graphical environments offer many more colors to use: normally we will
be using 16 colors or 256 colors. But we may use millions of colors
( depending on which mode we configure Windows to work in ). Note that
if you select more colors to use, Windows will work slower as it has
to manage more memory just to perform the same normal processes.
Also, we are going to use text and pictures ( Bitmaps ), different fonts,
brushes, etc. at the same time.
Standard xBase language is being extended to cover all these new graphical
environment features:
... COLOR <cXBASEColor> // Standard MsDos xBase color format
... COLOR <nRGBFore>, <nRGBBack> // Enhanced RGB colors management
... BRUSH <oBrush> // Brushes management
With colors, the main difference with respect MsDos is that we are going
to use RGB color formats. The RGB format is based on a LONG number ( four
bytes ) which lets us represent millions of different colors:
Four Bytes
0 BLUE GREEN RED
X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X
31 24 23 16 15 8 7 0
Bits order
We provide the #translate RGB() ( see Colors.ch ) to automatically
generate RGB values:
#translate RGB( <nRed>, <nGreen>, <nBlue> ) => ;
( <nRed> + ( <nGreen> * 256 ) + ( <nBlue> * 65536 ) )
Also, FiveWin provides the function nRGB() which uses the same parameters
and it may be called from inside your applications even at Run Time.
Another very important new feature is the use of Brushes. Brushes are
graphical Objects which automatically fill the surface of another
Object.
We may build Brushes from standard pure colors -which FiveWin performs
automatically in the constructor method when we build an Object- or
patterns based on Bitmaps.
FiveWin easily lets us keep using the already familiar xBase color
string format, or, to take advantage of the use of RGB colors and
Brush Objects.
FiveWin uses by default the System colors already defined. In Windows
to change the system colors we don't use SET COLOR TO ..., but instead
we have to go to the Control Panel and change from there all the colors
of the system.
See Also:
... COLOR ,
Brush Commands
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson