Skip to content

ReadPixelFast

Narta Xaymar Dirks edited this page Nov 25, 2026 · 10 revisions

ReadPixelFast BlitzBasic

ReadPixelFast:Int32 x:Int32, y:Int32, buffer:Int32=0
Parameter Mode Type Default Description
x In Int32 required Horizontal position of the pixel.
y In Int32 required Vertical position of the pixel.
buffer In Int32 0 The locked buffer to read from. Defaults to the current buffer.

Returns: The color of the pixel, or 0 if the position is outside of the buffer.

Description

Returns the color of a pixel of a locked buffer in the same form as ReadPixel. The buffer has to be locked with LockBuffer.

Differences

  • A buffer that is not locked is ignored by a build without -d (a read gives 0), and stops a debug build (-d) with an error message. In the original a position outside of the buffer reads other memory.
  • The buffers that Graphics3D makes with a depth above 32 are read as they are stored: with the depth 30 the number is A2R10G10B10, and with 64 it is ARGB with the upper 8 bits of each channel. ReadPixelFast64 gives all of them. See Color depth.

Related Commands

CopyPixel BlitzBasic, CopyPixelFast BlitzBasic, ReadPixel BlitzBasic, ReadPixel64 BlitzLLVM, ReadPixelFast64 BlitzLLVM, WritePixel BlitzBasic, WritePixelFast BlitzBasic, WritePixelFast64 BlitzLLVM

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally