save buffer to pic

Blitz3D Forums/Blitz3D Beginners Area/save buffer to pic

Chimeara(Posted 2004) [#1]
I'm using the following code to save a print screen:

If KeyHit(10)
CameraViewport camera,0,0,GraphicsWidth(),GraphicsHeight()
iFileNumber% = 0
Repeat
iFileNumber = iFileNumber + 1
sFileName$ = "Pictures\Screenshot" + String$("0", 3 - Len(Str$(iFileNumber))) + iFileNumber + ".bmp"
Until Not(FileType(sFileName))
SaveBuffer BackBuffer(), sFileName
CameraViewport camera,7.5,20,GraphicsWidth()-14,GraphicsHeight()-40
EndIf

but it doesn't change the camera viewport in time for the picture.
why not?
What can i do to fix it?


N(Posted 2004) [#2]
I'm not sure, but maybe you need an UpdateWorld in there?


Zethrax(Posted 2004) [#3]
More likely a need for 'RenderWorld' to render the 3D graphics to the backbuffer.