or,
that should work.
img=CreateImage(TerrainSize(t),TerrainSize(t)) SetBuffer ImageBuffer(img) LockBuffer For x=0 To TerrainSize(t)-1 For z=0 To TerrainSize(t)-1 c=TerrainHeight(t,x,z)*255 c=(c Shl 16) ;blitz only uses the red channel for heightmaps, but if you want greys, uncomment the next line ;c=(c Shl 16)+(c shl 8)+c WritePixelFast x,TerrainSize()-z,c Next Next UnlockBuffer SetBuffer BackBuffer()
that should work.