1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-24 10:12:20 -05:00
Simba/Tests/PS/MaskTest.simba

26 lines
890 B
Plaintext
Raw Normal View History

2010-04-09 16:02:20 -04:00
program new;
//http://nl.wikipedia.org/wiki/Lily_Allen
2010-04-16 11:04:50 -04:00
//This finds a mask of the text 'Op 24 september',
//so target wikipedia halfway down. Might not work because of
//different font's/sizes in your browser.
2010-04-09 16:02:20 -04:00
var
Bmp : integer;
Mask : TMask;
x,y : integer;
i, ii : integer;
w,h : integer;
begin
Bmp := BitmapFromString(107, 19, 'beNrtVkEOgCAM8/+fxoOJUYG' +
'uWwZKbE9KtmYrHbBtgiAIgpCOckFiopdtZr/j2HhynBjYjmntJxaW' +
'6BwJWC8eH6QU15gz0Zx9vFgX0Iwhs0CASRUW8CFmioB1JFisA5qRI' +
'KvJQNKa5mEcyAhoauI6N8ymAlkxWpdtwgL2bhPXCJc7+E7JLNJsgG' +
'qQgL1jhHwX4VJdBsNZMbN5D//m/ob5XzwDp40wfg/jW9g024hbuPd' +
'ritabVqaAj7zYVyxg9fol4M8FFG7YAfIG00k=');
2010-04-16 11:04:50 -04:00
Mask := CreateMaskFromBitmap(Bmp);
2010-04-09 16:02:20 -04:00
GetClientDimensions(w,h);
// if FindBitmapMaskTolerance(Bmp,x,y,0, 0,w-1, h-1,1,5) then
if FindMaskTolerance(Mask,x,y,0, 0,w-1, h-1,1,5) then
MoveMouse(x,y);
end.