1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-23 01:32:17 -05:00
Simba/Tests/PS/ColourTest2.simba

34 lines
724 B
Plaintext
Raw Normal View History

2010-04-09 16:02:20 -04:00
program new;
2010-04-16 11:04:50 -04:00
const
bmppath = 'C:\Carina_1_by_Eeitam.png';
2010-04-09 16:02:20 -04:00
var
p1, p2: TPointArray;
w, h: integer;
i, col: integer;
bmp: integer;
begin
SetColorToleranceSpeed(2);
2010-04-16 11:04:50 -04:00
bmp := LoadBitmap(bmppath);
2010-04-09 16:02:20 -04:00
SetTargetBitmap(bmp);
GetClientDimensions(W, H);
writeln(inttostr(w) + ' : ' + inttostr(h));
for i := 0 to 100 do
begin
col := Random(clWhite);
writeln(inttostr(col));
FindColorsTolerance(p1, col, 0, 0, W - 1, H - 1, 40);
FindColorsToleranceOptimised(p2, col, 0, 0, W - 1, H - 1, 40);
writeln(inttostr(length(p1)) + ' : ' + inttostr(length(p2)));
if(length(p1) <> length(p2)) then
writeln('wat!');
setlength(p1,0);
setlength(p2,0);
end;
FreeBitmap(bmp);
end.