[futurebasic] [FB] RGB Color

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : May 2001 : Group Archive : Group : All Groups

From: Marc Girondot <marc.girondot@...>
Date: Wed, 16 May 2001 13:41:44 -0700
Hye,

I try to get the color of the pixel of an image but there are some
inconstancies that I don't understand.
I define the RGB variable as
DIM AS RGBCOLOR rgb

and I obtain the color of the pixel by

call getcpixel(xh%, yh%, RGB)
with xh% and yh% the x and y position in the current window.

Then I obtain the color in
RGB.red%, RGB.blue% and RGBbg.green%

But what is the range of the color... sometimes I obtain negative
value... then I suspect that it ranges for -32767 to 32768, but
sometimes I obtain 65535... then I suspect that it ranges for 0  to
65535.

Furthermore, if I use:
long color RGB.blue%, RGB.green%, RGB.red%

The selected color is correct according to the RGB.blue%, RGB.green%,
RGB.red% even if they are negative whereas the reference manual
indicated that each parameter of long color should be from 0 to 65535
(it is the french manual).

I suspect that sometimes it shows the results in 2 bytes signed
(-32767 to 32768) or unsigned  (0 to 65535), but how to know if you
are in sign or unsign for a value between 0 and 32768 ?

Thanks a lot

Marc Girondot

--

__________________________________________________________
Marc Girondot, Pr
Université Paris-Sud, Paris XI
Laboratoire d'Ecologie, Systématique et Evolution
CNRS UPRESA 8079
Batiment 362
91405 Orsay Cedex
France

Tel:  01.69.15.72.30   Fax: 01 69 15 56 96   e-mail:
marc.girondot@...
Web: http://www.ese.u-psud.fr/epc/conservation/Marc.html