procedure ShowErrorMessage(Error:integer);
var
ErrorStr
Char;
begin
ErrorStr:=nil;
FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER or FORMAT_MESSAGE_FROM_SYSTEM,
nil,
Error,
0,
ErrorStr,
0,
nil
);
if ErrorStr<>nil then ShowMessage(ErrorStr);
end;
procedure GetSelectRectangle(DC:hDC;RC:TRect;var Bmp:TBitmap);
var
SelWidth,SelHeight:integer;
ErrorCode:integer;
begin
SelWidth:=RC.Right-RC.Left;
SelHeight:=RC.Bottom-RC.Top;
Bmp.Width:=Abs(SelWidth);
Bmp.Height:=Abs(SelHeight);
if not StretchBlt(Bmp.Canvas.Handle,0,0,Bmp.Width,Bmp.Height,DC,RC.Left,RC.Top,SelWidth,SelHeight,SRCCOPY) then begin
ErrorCode:=GetLastError;
ShowErrorMessage(ErrorCode);
end;
end;
GetSelectRectangle抓取就没有.
不知大虾是否能够公开抓去总是有光笔的函数