Page 1 of 1

what's the point?

Posted: Wed Sep 27, 2006 4:38 am
by Hrothgar
I'm having some trouble with the POINT command in FB. I'm using it to check the rgb colour values of the background against something else but for some reason it only works with rgb values of 0 or 255.

eg.

this works fine
dotcolour = point(x,y)
if dotcolour = &hFF00FF then blah blah blah

but this doesn't
dotcolour = point(x,y)
if dotcolour = &h808080 then blah blah blah

Any ideas??

Posted: Wed Sep 27, 2006 5:32 am
by {Nathan}
Yes, I have an idea.

Use the RBG() function, and find a converter for the hex to RBG.

http://www.kenjikojima.com/java/RGBHexConverter2.html

The above seems so work. If you need more, just google "hex color rbg converter."

-Nathan

Posted: Wed Sep 27, 2006 2:35 pm
by Antoni
What's the value returned by point?

Posted: Wed Sep 27, 2006 9:16 pm
by moneo
Antoni, que milagro ver tu nombre. ?Como has estado, hombre?

Un fuerte abrazo,
Eduardo Moneo

Posted: Thu Sep 28, 2006 4:09 am
by Hrothgar
The windows calculator is as good a converter as any and I've tried both using RGB() and &h.

It returns a value close to the colour but not the colour itself.

The picture that is being POINTed is a grey colour RGB(128,128,128) or &h808080 POINT returns 8684164 which is &h848284 in hex which is RGB(132,130,132)

it was BLOADed from a .BMP file too if that has anything to do with it.

Posted: Thu Sep 28, 2006 12:43 pm
by Z!re
What mode are you in?

Also, point returns a RGBA vlue, 32bit integer, NOT a 24bit RGB value.