So macht man einen screenshor in glscene:
Delphi-Quellcode:
procedure Tform1.RenderToBitmap(scale : Single;filename:string);
var
bmp : TBitmap;
pt : Int64;
delta : Double;
begin
pt:=StartPrecisionTimer;
// Rendering to a bitmap requires an existing bitmap,
// so we create and size a new one
bmp:=TBitmap.Create;
// Don't forget to specify a PixelFormat, or current screen pixel format
// will be used, which may not suit your purposes!
bmp.PixelFormat:=pf24bit;
bmp.Width:=Round(GLSceneViewer1.Width*scale);
bmp.Height:=Round(GLSceneViewer1.Height*scale);
// Here we just request a render
// The second parameter specifies DPI (Dots Per Inch), which is
// linked to the bitmap's scaling
// "96" is the "magic" DPI scale of the screen under windows
GLSceneViewer1.Buffer.RenderToBitmap(bmp, Round(96*scale));
delta:=StopPrecisionTimer(pt);
bmp.savetofile(filename);
bmp.Free;
end;
// aufruf
RenderToBitmap(1,'C:\test.bmp');