Aunque puede que esta otra forma de hacerlo te resulte mejor:
Código Delphi
[-]
procedure Capturar(Filename: string; Panel: TPanel);
var
FormImage: TBitmap;
Bitmap: TBitmap;
Jpg: TJPEGImage;
begin
if Panel.Owner is TForm then
begin
FormImage := TForm(Panel.Owner).GetFormImage;
Bitmap:= TBitmap.Create;
Jpg:= TJPEGImage.Create;
try
Bitmap.Width:= Panel.Width;
Bitmap.Height:= Panel.Height;
BitBlt(Bitmap.Canvas.Handle,0,0,Bitmap.Width,Bitmap.Height,
FormImage.Canvas.Handle,Panel.Left,Panel.Top,SRCCOPY);
Jpg.CompressionQuality:= 60;
Jpg.Assign(Bitmap);
Jpg.SaveToFile(Filename);
finally
FormImage.Free;
Bitmap.Free;
Jpg.Free;
end;
end;
end;