Results 1 to 2 of 2

Thread: FindColor - Canvas does not allow drawing...

  1. #1
    Join Date
    Aug 2007
    Location
    Emo-land
    Posts
    1,109
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindColor - Canvas does not allow drawing...

    OK so I'm using a new method... doesn't matter of what. But I get this error:

    [Runtime Error] : Exception: Canvas does not allow drawing in line 2108 in script C:\...

    The code is:

    SCAR Code:
    ExColor := GetColor(tx, ty);
    if Not(FindColorTolerance(x, y, ExColor, tx - 3, ty + 3, tx + 3, ty - 3, 0)) then
      Break;

    Gets a color then sees if it is in a 6sqpx box, why would it cause an error?

  2. #2
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You're trying to find a colour that isn't on the canvas.

    Before the FindColorTolerance put :

    SCAR Code:
    if tx < 3 then
      tx := 3;
    if ty < 3 then
      ty := 3;
    if tx > MMX2 - 3 then
      tx := MMX2 - 3;
    if ty > MMY2 - 3 then
      ty := MMY2 - 3;
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 05-28-2008, 07:01 PM
  2. [Runtime Error]:Canvas does not allow drawing
    By sp00nfu11 in forum OSR Help
    Replies: 3
    Last Post: 03-22-2008, 12:52 PM
  3. canvas does not allow drawing in line 153
    By oliver1205 in forum OSR Help
    Replies: 2
    Last Post: 02-23-2008, 06:21 PM
  4. Help: Canvas Does Not Allow Drawing
    By Xirx in forum OSR Help
    Replies: 8
    Last Post: 06-11-2007, 05:28 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
  •