Procedure TForm1.SaveScreen(FramePoint:TPoint;Filename:String);
//framepoint为panel的left和top
var
TempPoint:TPoint;
Dc: HDC;
begin
TempPoint.x:=FramePoint.x-2; //源设备场景
TempPoint.y:=FramePoint.y-2;
Bmp:= TBitMap.Create; //创建,设置其大小,目标设备场景
Dc:=GetDc(0);
bmp.Width:=panel1。width;//panel的宽度
bmp.Height:=panel1。height;//panel的长度
BitBlt(Bmp.Canvas.Handle,0,0,100,100,Dc,TempPoint.x,TempPoint.y,SRCCOPY);
Bmp.savetofile(filename);
ReleaseDc(0,Dc);
//释放DC资源
bmp.free;
end;