Docs » Autodocs » graphics.library » ReadPixel
ReadPixel -- read the pen number value of the pixel at a specified x,y location within a certain RastPort.
penno = ReadPixel( rp, x, y ) d0 a1 d0:16 d1:16 LONG ReadPixel( struct RastPort *, SHORT, SHORT );
Combine the bits from each of the bit-planes used to describe a particular RastPort into the pen number selector which that bit combination normally forms for the system hardware selection of pixel color.
rp - pointer to a RastPort structure (x,y) a point in the RastPort
penno - the pen number of the pixel at (x,y) is returned. -1 is returned if the pixel cannot be read for some reason.
WritePixel(), <graphics/rastport.h>
|