function ScreenCapture(X1,Y1,X2,Y2: Integer): HBitmap;
var
Width,Height: Integer;
SourceDC,DestDC,BHandle: Integer;
begin
Width:=x2-x1;
Height:=y2-y1;
SourceDC:=CreateDC('DISPLAY','','',nil);
DestDc:=CreateCompatibleDC(SourceDC);
BHandle:=CreateCompatibleBitmap(SourceDC,Width,Height);
SelectObject(DestDC,BHandle);
BitBlt(DestDC,0,0,Width,Height,SourceDC,X1,Y1,SRCCOPY);
DeleteDC(DestDC);
ReleaseDC(BHandle,SourceDC);
Result:=BHandle;
end;
var
Width,Height: Integer;
SourceDC,DestDC,BHandle: Integer;
begin
Width:=x2-x1;
Height:=y2-y1;
SourceDC:=CreateDC('DISPLAY','','',nil);
DestDc:=CreateCompatibleDC(SourceDC);
BHandle:=CreateCompatibleBitmap(SourceDC,Width,Height);
SelectObject(DestDC,BHandle);
BitBlt(DestDC,0,0,Width,Height,SourceDC,X1,Y1,SRCCOPY);
DeleteDC(DestDC);
ReleaseDC(BHandle,SourceDC);
Result:=BHandle;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货