Important: The information in this document is obsolete and should not be used for new development.
GetPixel
To determine whether the pixel associated with a point is black or white, use theGetPixel
function.
FUNCTION GetPixel (h,v:\xDDInteger):\xDDBoolean;
h
- The horizontal coordinate of the point for the pixel to be tested.
v
- The vertical coordinate of the point for the pixel to be tested.
DESCRIPTION
TheGetPixel
function examines the pixel at the point specified by theh
andv
parameters and returnsTRUE
if the pixel is black orFALSE
if it iswhite
.The selected pixel is immediately below and to the right of the point whose coordinates you supply in the
h
andv
parameters, in the local coordinates of the current graphics port. There's no guarantee that the specified pixel actually belongs to the current graphics port, however; it may have been drawn in a graphics port overlapping the current one. To see if the point indeed belongs to the current graphics port, you could use thePtInRgn
function (described in the chapter "QuickDraw Drawing" in this book) to test whether the point is in the current graphics port's visible region, as shown here.
PtInRgn(pt, thePort^.visRgn);