procedure Capturar_Pantalla;
var
c: TCanvas;
r: TRect;
Foto: TBitmap;
FotoJPEG : TJPEGImage;
begin
c := TCanvas.Create;
c.Handle := GetWindowDC(GetDesktopWindow);
try
r := Rect(0, 0, Screen.Width, Screen.Height);
Foto := TBitmap.Create;
Foto.Width := Screen.Width;
Foto.Height := Screen.Height;
Foto.Canvas.CopyRect(r, c, r);
FotoJPEG := TJPEGImage.Create;
FotoJPEG.Assign(Foto);
FotoJPEG.SaveToFile('MiCaptura.jpg');
finally
ReleaseDC(0, c.Handle);
Foto.Free;
FotoJPEG.Free;
c.Free;
end;
end;