From 841f228a0fd2d8ba8660c9863818e4aa29c80e73 Mon Sep 17 00:00:00 2001 From: Merlijn Wajer Date: Sat, 30 Jul 2011 13:46:10 +0200 Subject: [PATCH] Tests: Add BmpBench. --- Tests/PS/bmpbench.simba | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Tests/PS/bmpbench.simba diff --git a/Tests/PS/bmpbench.simba b/Tests/PS/bmpbench.simba new file mode 100644 index 0000000..dc9acea --- /dev/null +++ b/Tests/PS/bmpbench.simba @@ -0,0 +1,34 @@ +program new; +//http://farm4.static.flickr.com/3067/2612399892_7df428d482.jpg +{Make the above bitmap your target} +var + Bmp : integer; + x,y : integer; + w,h : integer; + t, i, c: integer; +begin + Bmp := createBitmap(15, 10); + FastDrawClear(bmp, clRed); + GetClientDimensions(w,h); + writeln(w); + writeln(h); + + for c := 0 to 2 do + begin + writeln('cts: ' + inttostr(c)); + setcolortolerancespeed(c); + + t:=getsystemtime; + for i := 0 to 100 do + findBitmapToleranceIn(bmp,x,y,0,0,w-1,h-1,10); + writeln((getsystemtime-t) / 100.0); + if findBitmapToleranceIn(bmp,x,y,0,0,w-1,h-1,200) then + writeln('found'); + end; + + {if FindBitmapToleranceIn(bmp,x,y,0,0,w-1,h-1,300) then + begin + writeln('found'); + MoveMouse(x,y); + end;} +end.