Log in

View Full Version : SCAR Pipe



solarwind
07-06-2008, 10:50 PM
Hey all,
I haven't been here in quite a long time but I have a simple question regarding SCAR.

I'm making an OCR script using the tesserect engine. I have compiled the executables but now I need to execute them.

Is there a way to execute an external executable in SCAR? Is there a way to pipe the output into SCAR?

n3ss3s
07-07-2008, 12:56 PM
Umm... I'm not sure what do you need but how about making a plugin?

solarwind
07-07-2008, 01:01 PM
Umm... I'm not sure what do you need but how about making a plugin?

Ummm. I just need to be able to execute an external program from SCAR. With a pipe if possible.

Markus
07-07-2008, 01:24 PM
You can do it with API calls, and as for the output, Freddy released the InterScarMessage source.

Smartzkid
07-07-2008, 05:58 PM
As Markus said, you can use API calls, but people must first enable them within SCAR (and you have to do it every time you run scar, too), so if you want to distribute what you make in the future, I'd recommend you use a delphi/c++ plugin.

solarwind
07-07-2008, 05:59 PM
Thanks for the replies, but only I will be using this script. I tried to search for documentation regarding the "API calls" but without any result. Can anyone provide a simple example for this or point me to relevant documentation?

bullzeye95
07-07-2008, 06:04 PM
I found this, which I had apparently made a while ago...
program New;
var
BMP, T: Integer;

const
SRCCOPY = 13369376;
SRCINVERT = 6684742;
DSTINVERT = 5570569;
SRCAND = 8913094;
SRCPAINT = 15597702;
SRCERASE = 4457256;

function BitBlt(hdcDest: HDC; nXDest, nyDest, nWidth, nHeight: Integer; hdcSrc: HDC; nXSrc, nYSrc: Integer; dwRop: Cardinal): Boolean; external 'BitBlt@gdi32.dll stdcall';
function StretchBlt(hdcDest: HDC; nXOriginDest, nYOriginDest, nWidthDest, nHeightDest: Integer; hdcSrc: HDC; nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc: Integer; dwRop: Cardinal): Boolean; external 'StretchBlt@gdi32.dll stdcall';

begin
BMP:= BitmapFromString(700, 700, '');
T:= GetSystemTime;
StretchBlt(GetBitmapDc(BMP), 0, 0, 700, 700, GetClientCanvas.Handle, 0, 0, 50, 50, SRCCOPY);
writeln(inttostr(GetSystemTime - T));
DisplayDebugImgWindow(700, 700);
SafeDrawBitmap(BMP, GetDebugCanvas, 0, 0);
FreeBitmap(BMP);
end.