problems with modifyterrain command

Blitz3D Forums/Blitz3D Programming/problems with modifyterrain command

Or you could save your changes out as a bitmap?
(Forget where I got this but it was somewhere on this forum, again thanks, guys.)

f1$ = "bmp\terrain\height.bmp"
f2$ = "bmp\terrain\heightbak1.bmp"
If FileType(f1$)=1 Then CopyFile f1$,f2$
gridsize = TerrainSize(hEntTerrain)
img = CreateImage(gridsize,gridsize)
ib = ImageBuffer(img)
LockBuffer ib
For x=1 To gridsize
For y=1 To gridsize
WritePixel x, gridsize-y-1, Floor(TerrainHeight#(hEntTerrain,x,y)*16777215.0),ib
Next
Next
UnlockBuffer ib
filename$ = "bmp\terrain\height.bmp"
SaveImage(img,filename$)
FreeImage img