From: "Peter Below (TeamB)" <100113.1101@compuXXserve.com> Subject: Re: capture screen Date: 13 Jul 1999 00:00:00 GMT Message-ID: Content-Transfer-Encoding: 8bit References: <378B0B4D.FB79144D@Euregiosite.com> Content-Type: text/plain; charset=iso-8859-1 Organization: TeamB Mime-Version: 1.0 Reply-To: 100113.1101@compuXXserve.com Newsgroups: borland.public.delphi.winapi In article <378B0B4D.FB79144D@Euregiosite.com>, wrote: > How can I grab the active screen like the alt+print screen buttons but > then in source code? > Procedure SaveScreenImageToFile( Const afilename: String ); var ScreenCanvas: TCanvas; bmp: TBitmap; R: TRect; begin ScreenCanvas:= TCanvas.Create; try ScreenCanvas.handle := CreateDC( 'DISPLAY', Nil, Nil, Nil ); R:= Rect( 0, 0, Screen.Width, Screen.Height ); bmp:= TBitmap.Create; try bmp.width := screen.width; bmp.height := screen.height; bmp.canvas.copyrect( R, ScreenCanvas, R ); bmp.SaveToFile( aFilename ); finally bmp.free; end; finally DeleteDC( ScreenCanvas.Handle ); ScreenCanvas.Free; end; end; Peter Below (TeamB) 100113.1101@compuserve.com) No replies in private e-mail, please, unless explicitly requested!