Results 1 to 10 of 10

Thread: FindDeformedBitmapToleranceIn

  1. #1
    Join Date
    Mar 2009
    Location
    Illinois/USA
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindDeformedBitmapToleranceIn

    I am having a hell of a time with this. I simply ask can someone throw me an example of FindDeformedBitmapToleranceIn as a standalone in use with the files to do it so I can see what I am doing wrong? I am able to get the code for FindBitmap to work fine and pretty much all associated with it except the one I need. Sorry if this is in the wrong section (first post).

  2. #2
    Join Date
    Mar 2009
    Location
    Illinois/USA
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Does anyone use FindDeformedBitmapToleranceIn?

  3. #3
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    don't double post pl0x?

    SCAR Code:
    FindDeformedBitmapToleranceIn(Bitmap, bx, by, MSX1, MSY1, MSX2, MSY2, 7, 7, True, 0.5);

    is that what you wanted to know?

    and what is this for? I bet their is a better way

  4. #4
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    You could use FindBitmapTolerancein(Bitmap, x, y, x1, y1, x2, y2, tol); Its easier to use.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  5. #5
    Join Date
    Mar 2009
    Location
    Illinois/USA
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry about the double post, and this is for basically.. me learning scar's pascal.

    I'm simply trying to get it to find the bank symbol in RS (on the mini map) and click on it even when the image has a white dot (person) on it. But whenever I try this code I am unable to make it work. I simply cannot find the image with this line of code.

    Here is my test code. I select the window of mspaint.exe and drag the image in paint to somewhere further in then at 0,0.

    SCAR Code:
    program findTestTarget;

    var
    pic,x,y : integer;
    b : boolean;
    acc : extended;

    procedure loadBitmaps;
    begin
    pic := BitmapFromString(25, 24, 'beNrN1UEKwCAMBMDtb/oOr/0/' +
           '/U1pISCiYUnCIpU9eRgihgTg525HD6pnRKZIkKAWEYJmjXI1FVV2I' +
           'hQavpzX02M3XHOdEZmSoohj5bmUW3CWMi3rkDf+k1q1AiX/QS21aq' +
           'RFuRNssP2TQTv6suDmNVFcXi/8Qvf1');
    end;

    begin
    writeln('Program Begin..');
    b:= false; //output result boolean

    loadBitmaps;

    //My original statement to find the first bitmap
    //if( findbitmapin(pic,x,y,0,0,600,600) )then
    //The finddeformed bitmap line, doesn't work!
    if( findDeformedBitmapToleranceIn(pic,x,y,0,0,600,600,70,0,true,acc) )then
    //change the 600,600 to your window search area ^^^
    begin
    b:= true;
    writeln('Bitmap Found');
    //Just puts cursor over image
    moveMouseSmooth(x,y);
    end;

    //tells output couldn't find the image.
    if(b = false)then
    begin
    writeln('Bitmap Not Found');
    end;

    freeBitmap(pic);
    writeln('Program end.');
    end.

    The image in the procedure is the original from the help HTML file, and I'm trying to find a distorted version of it (I.E drew a white dot about 2x2 pixals in it). Do you see what I am doing wrong?

  6. #6
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Its the ACC part. Just Use FindBitmapMapTolerancein(). Its easier to use, just a tad slower. Few hundred ms.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  7. #7
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try taking a look at how SRL does it.

  8. #8
    Join Date
    Mar 2009
    Location
    Illinois/USA
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright, I tried the same exact code, but with:

    SCAR Code:
    if( findDeformedBitmapToleranceIn(pic,x,y,0,0,600,600,70,0,true,acc) )then

    //as the below code.

    if( findBitmapToleranceIn(pic,x,y,0,0,600,600,100) )then

    And it cannot find the picture once again. (Remember the picture I'm looking at differs from the picture I put in the procedure by having a small white dot in it.)

    And:
    Try taking a look at how SRL does it.
    What do you mean, how SRL does it, can you link me somewhere or am I misunderstanding?

  9. #9
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    tRY MAKING A NEW bITMAP. pLUSS THATS TOO MUCH TOLERANCE, THE 0, 0, 60, 60 ARE THE CO-ORDS YOUR SEARCHING FOR THE BITMAP IN.(crap sorry for capslock) So is this for RS? If so main screen = msx1, msy1, msx2, msy2. Inv = mix1, miy1, mix2, miy2. minimap = mmx1, mmy1, mmx2, mmy2
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  10. #10
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    http://85.17.90.18/repositories/srl-...re/Symbol.scar

    Also have it just writeln the coords, just to be safe. Or use Mouse/MMouse from SRL.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 07-08-2007, 04:13 PM
  2. Question about FindDeformedBitmapToleranceIn
    By Rambozin in forum OSR Help
    Replies: 30
    Last Post: 05-05-2007, 11:13 AM
  3. FindDeformedBitmapToleranceIn
    By raimis89 in forum OSR Help
    Replies: 9
    Last Post: 01-12-2007, 03:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •