Graphics Function: Sets a pixel at a specified location to the current graphics color index.
Module: USE DFLIB
Syntax
Results:
The result is of type INTEGER(2). The result is the previous color index of the target pixel if successful; otherwise, -1 (for example, if the pixel lies outside the clipping region).
SETPIXEL sets the specified pixel to the current graphics color index. The current graphics color index is set with SETCOLOR and retrieved with GETCOLOR. The non-RGB color functions (such as SETCOLOR and SETPIXELS) use color indexes rather than true color values.
If you use color indexes, you are restricted to the colors available in the palette, at most 256. Some display adapters (SVGA and true color) are capable of creating 262,144 (256K) colors or more. To access any available color, you need to specify an explicit Red-Green-Blue(RGB) value with an RGB color function, rather than a palette index with a non-RGB color function. SETPIXELRGB and SETPIXELRGB_W give access to the full color capacity of the system by using direct color values rather than indexes to a palette.
Compatibility
STANDARD GRAPHICS QUICKWIN GRAPHICS LIB
See Also: SETPIXELRGB, GETPIXEL, SETPIXELS, GETPIXELS, GETCOLOR, SETCOLOR
Example
! Build as a Graphics ap.
USE DFLIB
INTEGER(2) status, x, y
status = SETCOLOR(INT2(2))
x = 10
! Draw pixels.
DO y = 50, 389, 3
status = SETPIXEL( x, y )
x = x + 2
END DO
READ (*,*) ! Wait for ENTER to be pressed
END