home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
271_02
/
vidpixel.doc
< prev
next >
Wrap
Text File
|
1987-08-20
|
2KB
|
51 lines
NAME
vid_wrpix -- write a pixel to the screen
vid_rdpix -- read a pixel from the screen
SYNOPSIS
(void) vid_wrpix(x, y, clr);
clr = vid_palette(x, y);
int x, y; x and y screen coordinates
int clr; one of the 4 color values for current palette
DESCRIPTION
These two functions manipulate the CGA card, or EGA card in
CGA graphics mode.
vid_wrpix() will set the pixel at location x,y to the color
clr, which is 0, 1, 2, or 3. The real color will be as
set via vid_palette(). For black and white 640 graphics,
use 0 or 1 only.
vid_rdpix() will return the color value (0-3) at the specified
x,y location.
If using black&white 640 x 200 graphics mode on a CGA, then
the color value for vid_wrpix should be 0 or 1. 0 will set
the pixel to black (which is the background color), and 1 will
set the pixel to the color which has been previously selected
by vid_border() (the default is, of course, white). In BW640
mode, therefore, the pixels can only be turned on or off. There
is no possibility of multi-color displays.
These functions do not support the extra modes of the EGA or PGA
adapters.
EXAMPLE
vmode(CG320); /* set 320 color graphics mode */
vid_border(BLUE); /* set border and graphics background color */
vid_palette(1); /* select palette 1 */
vid_wrpix(10, 10, 2) /* write a pixel at x10, y10, color 2,
which is magenta in palette 1 */
This function is found in SMTCx.LIB for the Turbo-C Compiler.