Skip to content

LockedPitch

Narta Xaymar Dirks edited this page Oct 28, 2026 · 6 revisions
BlitzPlus

LockedPitch

LockedPitch:Int32 buffer:Int32=0
Parameter Mode Type Default Description
buffer In Int32 0 Locked buffer. Defaults to the current one.

Returns: Bytes in a row. For the buffer of a 200 pixel wide canvas that is 800.

Description

Gives how many bytes one row of pixels of a locked buffer takes, which you need to find the pixel at x, y: y * pitch + x * 4.

Differences

  • A buffer that Graphics3D made with the depth 64 has 8 bytes for each pixel, so a row takes width * 8 bytes. See Color depth.

Examples

Graphics 320, 240, 32, 2
win = CreateWindow("Pitch", 20, 20, 240, 150, Desktop(), 3)
cv  = CreateCanvas(10, 10, 200, 100, win)
buf = CanvasBuffer(cv)
LockBuffer buf
SetGadgetText win, "A row is " + LockedPitch(buf) + " bytes"
UnlockBuffer buf
Repeat
Until WaitEvent() = $803

Related Commands

FlipCanvas, LockedFormat, LockedPixels

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally