Cazax
2009-05-29 04:51:19
I think that TakeScreenshot should have parameters to define the area to be taken. To not break any script it should be called TakeScreenshotEx:
{*******************************************************************************
procedure TakeScreenshotEx(Path: string; X1, Y1, X2, Y2 : Integer);
By: lordsaturn small edit by Cazax
Description: Takes a screenshot, saving it to 'Path'. Checks that .bmp is present. Supports custom area.
*******************************************************************************}
procedure TakeScreenshotEx(Path: string; X1, Y1, X2, Y2 : Integer);
var
bmp : integer;
begin
bmp:= BitmapFromString(X2 - X1, Y2 - Y1, '');
SafeCopyCanvas(GetClientCanvas, GetBitmapCanvas(bmp), 0, 0, X2 - X1, Y2 - Y1, 0, 0, X2 - X1, Y2 - Y1);
if Pos('.bmp', Path) = 0 then
Path := Path + '.bmp';
try
SaveBitmap(bmp, Path);
except
Writeln('Failed saving screenshot to ' + Path);
Exit;
finally
FreeBitmap(bmp);
end;
Writeln('Screenshot saved successfully to ' + Path);
end;And btw I'm talking about Debug.scar