Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 pic ids
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Andy




PostPosted: Sun Jan 11, 2004 9:06 pm   Post subject: pic ids

ok i know how to take a snap shot on the screen but what i want to know is i you save two pictures using Pic.Save can you compare them to see if they're the same picture?
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Sun Jan 11, 2004 9:53 pm   Post subject: (No subject)

compare them in Turing or in Windows?

I haven't used Pic.Save before.. the only way I can think to compare them is to compare their file sizes. I know that doesn't mean they're the same, but its the best I can do Neutral
McKenzie




PostPosted: Sun Jan 11, 2004 10:05 pm   Post subject: (No subject)

You have to use this interesting function called whatdotcolour, maybe you've heard of it
code:

var same :=true
Pic.Draw(firstpic,somex,somey,picXor)
Pic.Draw(secondpic,somex,somey,picXor)
for x:somex .. somex + picWidth -1
    for y:somey .. somey + picHeight -1
        if whatdotcolour(x,y) > 0 then
            same := false
        end if
    end for
end for
Cervantes




PostPosted: Sun Jan 11, 2004 10:10 pm   Post subject: (No subject)

whatdotcolour? never heard of it! Thinking
but the whatdotcolour > 0 part confuses me.... so your just checking the outline..?
McKenzie




PostPosted: Sun Jan 11, 2004 10:10 pm   Post subject: (No subject)

but seriously you can just open them up as binary files read one character at a time from each and compare them this way.
McKenzie




PostPosted: Sun Jan 11, 2004 10:16 pm   Post subject: (No subject)

it'll work, but it was a joke. Dodge loves whatdotcolour, and I recently wrote a tutorial on the almost useless ability to draw pics using picXor. I figured why not combine them? whatdotcolour is actually quite usefull. What it does is return the colour value of a pixel on the screen. In this case if both pics are the same the XOR will cause the to blank out. So I check the entire area to see if its all white.
Cervantes




PostPosted: Sun Jan 11, 2004 10:23 pm   Post subject: (No subject)

yeah I kinda noticed his love for whatdotcolor lol. I love it too Very Happy (btw what I said about never heard of it was a joke too)
McKenzie




PostPosted: Sun Jan 11, 2004 10:26 pm   Post subject: (No subject)

oops, should have figured that when you asked about the outline Embarassed
Cervantes




PostPosted: Sun Jan 11, 2004 10:28 pm   Post subject: (No subject)

indeed. Razz

dodge what do you need this for?? are you just playing around or are you making some elaborate program (that I'm assuming would use whatdotcolor exclusively Razz)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: