Author |
Message |
Andy
|
Posted: 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
|
|
|
Cervantes
|
Posted: 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 |
|
|
|
|
|
McKenzie
|
Posted: 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
|
Posted: Sun Jan 11, 2004 10:10 pm Post subject: (No subject) |
|
|
whatdotcolour? never heard of it!
but the whatdotcolour > 0 part confuses me.... so your just checking the outline..? |
|
|
|
|
|
McKenzie
|
Posted: 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
|
Posted: 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
|
Posted: Sun Jan 11, 2004 10:23 pm Post subject: (No subject) |
|
|
yeah I kinda noticed his love for whatdotcolor lol. I love it too (btw what I said about never heard of it was a joke too) |
|
|
|
|
|
McKenzie
|
Posted: Sun Jan 11, 2004 10:26 pm Post subject: (No subject) |
|
|
oops, should have figured that when you asked about the outline |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Cervantes
|
Posted: Sun Jan 11, 2004 10:28 pm Post subject: (No subject) |
|
|
indeed.
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 ) |
|
|
|
|
|
|