Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> getdotcolor get pixel color pp 174</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 GETDOTCOLOR                  Get Pixel Color                         pp 174

 Syntax:  GetDotColor (X,Y) ;

 Type:    Integer

 Form:    Extended Graphics Function

 Purpose: Returns color value of graphics pixel at X,Y coordinates.

 Notes:   Requires {$I Graph.P} include file in the source file.
          Values 0..3 may be returned in 320x200 mode graphics,
          or 0..1 in 640x200 mode.  If X,Y is outside the active
          window, then -1 is returned.


 ----------------------------------------------------------------------------



 Usage:
          {$I Graph.P}                     { Extended graphics support }
       VAR
          X,Y    : Integer            ;    { Row, Col coordinates      }
          IntVar : Integer            ;    { Color value               }


       BEGIN
          GraphColorMode              ;    { Set 320x200 graphics mode }
          IntVar := GetDotColor (X,Y) ;    { Read the pixel color      }
       END.

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