Einzelnen Beitrag anzeigen

Benutzerbild von arbu man
arbu man

Registriert seit: 3. Nov 2004
Ort: Krefeld
1.108 Beiträge
 
Delphi 7 Professional
 
#22

Re: Facharbeit - 3D Topographie anzeigen

  Alt 8. Jan 2006, 15:47
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');
Björn
>> http://bsnx.net <<
Virtual DP Stammtisch v1.0"iw" am 19.09.2007 - ich war dabei!
  Mit Zitat antworten Zitat