## what's the point?

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Hrothgar
Coder
Posts: 25
Joined: Tue Nov 22, 2005 8:32 pm
Location: Perth, Oz

### what's the point?

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??

Towels may be harmful if swallowed in large quantities.

{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:
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

Antoni
Veteran
Posts: 132
Joined: Wed Jun 15, 2005 3:01 pm
Contact:
What's the value returned by point?

moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico
Antoni, que milagro ver tu nombre. ?Como has estado, hombre?

Un fuerte abrazo,
Eduardo Moneo

Hrothgar
Coder
Posts: 25
Joined: Tue Nov 22, 2005 8:32 pm
Location: Perth, Oz
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.

Towels may be harmful if swallowed in large quantities.

Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am
What mode are you in?

Also, point returns a RGBA vlue, 32bit integer, NOT a 24bit RGB value.
I have left this dump.