var
DC : HDC;
bmp: TBitmap;
begin
dc := GetWindowDC(Panel1.Handle);
bmp := TBitmap.Create;
try
bmp.Width := Panel1.Width;
bmp.Height := Panel1.Height;
BitBlt(bmp.Canvas.Handle, 0, 0, bmp.Width, bmp.Height, DC, 0, 0, SRCCOPY);
bmp.SaveToFile('c:\temp.bmp');
finally
bmp.Free;
ReleaseDC(Panel1.Handle, DC);
end;
end;