Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <graph.h>
    short _FAR _getpixel( short x, short y );

    short _FAR _getpixel_w( double x, double y );

Description:
    The _getpixel functions return the pixel value for the point with
    coordinates (x,y).  The _getpixel function uses the view coordinate
    system.  The _getpixel_w function uses the window coordinate system.

Returns:
    The _getpixel functions return the pixel value for the given point when
    the point lies within the clipping region; otherwise, (-1) is returned.

See Also:
    _setpixel, _setpixel_w

Example:
    #include <conio.h>
    #include <graph.h>
    #include <stdlib.h>

    main()
    {
        int x, y;
        unsigned i;

        _setvideomode( _VRES16COLOR );
        _rectangle( _GBORDER, 100, 100, 540, 380 );
        for( i = 0; i <= 60000; ++i ) {
            x = 101 + rand() % 439;
            y = 101 + rand() % 279;
            _setcolor( _getpixel( x, y ) + 1 );
            _setpixel( x, y );
        }
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
     _getpixel - DOS, QNX

    _getpixel_w - DOS, QNX

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson