Lightweight Graphics

GPutPixel

Draw a pixel

Syntax

Signature
void GPutPixel( int y, int x, int color );

Arguments

y, x give the pixel position, vertical coordinate first.

color is the RGB color returned by GMakeColor().

Return value

No return value.

Description

Draws a single pixel within the current clip. The example uses every other horizontal coordinate to create a dotted line.

Example

gputpixel.c
#include "xdev-wtui.h"

int main( void )
{
   int white = GMakeColor( 255, 255, 255 );

   for( int x = 0; x < 200; x += 2 )
      GPutPixel( 50, x, white );

   Inkey( 0, NIL );

   return 0;
}

See also