How to take a snapshot from the GLScene viewer

Sample code using GLSceneViewer1.Buffer.CreateSnapShot

procedure TForm1.TakeSnapShot;
var bm : TBitmap;
bmp32 : TGLBitmap32;
begin
bmp32:=GLSceneViewer1.Buffer.CreateSnapShot;
try
bm:=bmp32.Create32BitsBitmap;
try
SavePictureDialog1.DefaultExt := GraphicExtension(TBitmap);
SavePictureDialog1.Filter := GraphicFilter(TBitmap);
if SavePictureDialog1.Execute then
bm.SaveToFile(SavePictureDialog1.FileName);
finally
bm.Free;
end;
finally
bmp32.Free;
end;
end;

Theres also a demo in your GLScene folder...\Demos\rendering\tobitmap