Forum Discussion

tyrus's avatar
tyrus
Contributor
8 years ago

Picture Compare

Hi I'm trying to use Compare Method

 

var picA = "mypicA.png"

var picB = "mypicB.png"

 

picA.Compare(picB, false, 0, false, 0, "")

 

I get this error:

"the value cannot be converted to the picture object"

 

when I use:

picA.Compare(picB)

 

it works fine

 

anyone seen this error?

 

thanks in advacne

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    The problem is that you are, kinda, doing it as strings... at least, if what you've posted is the entirety of your code.  As it is, if I copy paste what you did into my environment, I get that Compare is not a method on picA.  

     

     

    Now... I have to assume that what you're actually doing is something like

     

     

    var picA = Utils.Picture;
    var picB = Utils.Picture;
    
    picA.LoadFromFile("C:\\MyPath\\mypicA.png");
    picB.LoadFromFile("C:\\MyPath\\mypicB.png");

    in which case, it SHOULD work as you have written it... although, your fourth parameter MAY be the issue... You are using two external files so it MIGHT be that, because they don't have their origin in an actual application and, therefore, might not have the mouse pointer on screen, it could be blowing up there.

    So... could you post the actual code you are using? That would be a lot easier to debug then guessing.