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

Username:   Password: 
 RegisterRegister   
 Something about whatdotcolor
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
KukuriChan




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: 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.
Mazer




PostPosted: 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.
KukuriChan




PostPosted: 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. Sad There's white spots all over the place.
Mazer




PostPosted: 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.
KukuriChan




PostPosted: 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
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  [ 6 Posts ]
Jump to:   


Style:  
Search: