做特定路径下截图,
var
SourceDC,DestDC,Bhandle:integer;
Bitmap:TBitmap;
phandle:tHandle;
pp:string;
begin
phandle:=loadimage(0,'C:\WINNT\Web\starter.bmp',IMAGE_BITMAP,0,0,LR_DEFAULTSIZE);
pp:=getlasterror();
showmessage(pp);
SourceDC:=Getdc(phandle);
DestDC:=CreateCompatibleDC(SourceDC);
Bhandle:=CreateCompatibleBitmap(SourceDC,100,100);
SelectObject(DestDC,Bhandle);
BitBlt(DestDC,0,0,100,100,SourceDC,300,300,SRCCOPY);
Bitmap:=TBitmap.Create;
Bitmap.Handle:=BHandle;
BitMap.Savetofile('C:\Program Files\Borland\Delphi7\Projects\xuesheng.bmp');
Bitmap.Free;
DeleteDC(DestDC);
ReleaseDC(Bhandle,SourceDC);
end;结果截到的是当前界面部分,为什么?