< Previous | Contents | Next >

Summary

This function will sample an arbitrary position from the coordinates specified by the first two arguments, and fill the Pixel object p with values from the sampled pixels. The X and Y arguments are floating-point pixel coordinates, with 0,0 being the bottom-left corner and <width-1>,<height-1> being the top-right corner. Unlike GetPixel, if the coordinates do not align exactly with a pixel then bilinear filtering will be performed with neighbouring pixels.

If the coordinates provided are outside the actual bounds of the image, the return value will be a black/transparent pixel. See SamplePixelW and SamplePixelD for functions that treat out of bound sampling in different ways.