Results 1 to 4 of 4

Thread: ColourPicking help needed pls.

  1. #1
    Join Date
    Nov 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default ColourPicking help needed pls.

    Hi, im a total noob, been at this 2 days now.

    Been trawling the forums, tuts and help sites but cant seem to find a good piece of code for identifying a colour within a boxed area.

    I've got this far..

    program FindMyColor;

    var
    x, y: integer;

    begin
    cleardebug;
    Findcolor(x, y, 65535, 685, 124, 720, 111);
    writeln(inttostr(x));
    writeln(inttostr(y));
    end.

    But x and y are always returned as black (0), I know yellow(65535) is there.

    preferably I would like a result returned as true/false so i can put a condition (if-then) to go into the next part of code. I'll bang my head against a wall later for that one if i have to though.

    Super-duper ideally i'd love to be able to set out my box co-ordinates and capture any colours within so i can true/false them. (Month left till xmas though).

    Anyone wanna dump some code on me feel free, a slap on the back of me head and a finger pointing the way would be gratefully recieved too.

  2. #2
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    SCAR Code:
    program FindMyColor;

    var
    x, y: integer;

    begin
      cleardebug;
      if Findcolor(x, y, 65535, 685, 124, 720, 111) then
      begin
        writeln(inttostr(x));
        writeln(inttostr(y));
      end else
        writeln(':(');
    end.

    is that what you want?
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  3. #3
    Join Date
    Nov 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dont fully understand why the small changes you made did the trick - but they did.
    Guess I've learned something new.
    Proud for getting as close as i did though.

    Many Thanks Awkwardsaw, much appreciated.

  4. #4
    Join Date
    Jan 2007
    Posts
    834
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Returns true or false if the color was found. In this case if it did, then it will writeln the x and y. Else, meaning anything else. Will return in a unhappy face meaning it wasn't found. Press f1 in scar to read these functions. Ctrl - f helps

Thread Information

Users Browsing this Thread

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

Posting Permissions

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