Something about whatdotcolor
Author |
Message |
KukuriChan
|
Posted: Mon Mar 15, 2004 7:41 pm Post subject: Something about whatdotcolor |
|
|
I just want to know whether or not it is possible to use whatdotcolor with pictures. Say, for example, if you put your mouse over a red section in the picture, it'll tell you that the colour is red. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Paul
![](http://i12.photobucket.com/albums/a207/paulbian/DDRDuck.png)
|
Posted: Mon Mar 15, 2004 7:52 pm Post subject: (No subject) |
|
|
I think so, like I tried with one of my pics:
code: |
var gorilla := Pic.FileNew ("blower.bmp")
Pic.Draw (gorilla, 150, 70, picMerge)
var x, y, btn: int
loop
Mouse.Where (x, y, btn)
if btn=1 then
locate (1, 1)put whatdotcolor (x, y)
end if
end loop
|
it told me the color of where I was clicking. |
|
|
|
|
![](images/spacer.gif) |
Mazer
![](http://compsci.ca/v3/uploads/user_avatars/1323750815476d9f446d80c.png)
|
Posted: Mon Mar 15, 2004 7:57 pm Post subject: (No subject) |
|
|
Yes. Somewhat.
Just a few things though: first, maybe you already know but just to make sure, whatdotcolour isn't going to say 'red', it'll give you a number (probably 12 depending on the shade of red). Second, turing can draw a picture (from a file) in whatever colour mode the picture is in, but it can only 'see' in 256 colours. So if you compare turing's red with a colour that is just slightly off-red, it'll still give you 12. |
|
|
|
|
![](images/spacer.gif) |
KukuriChan
|
Posted: Mon Mar 15, 2004 8:03 pm Post subject: (No subject) |
|
|
Ok. I get it. Thanks! That helped a lot. But.... there's something wrong with the picture. There's white spots all over the place. |
|
|
|
|
![](images/spacer.gif) |
Mazer
![](http://compsci.ca/v3/uploads/user_avatars/1323750815476d9f446d80c.png)
|
Posted: Mon Mar 15, 2004 8:05 pm Post subject: (No subject) |
|
|
Hmm... you should explain further but my guess is you're using a JPG with a "white" background, trying maybe to draw it with picMerge. But you can't, because the JPG compression is terrible and you get lots of pixels that are off white. |
|
|
|
|
![](images/spacer.gif) |
KukuriChan
|
Posted: Mon Mar 15, 2004 8:10 pm Post subject: (No subject) |
|
|
I did it with picMerge. That's the only reason there's white spots all over the place. ^^ So I tried it with picXor and there's no white spots now.
Thanks for the help Mazer. ![Smile Smile](http://compsci.ca/v3/images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
|
|