Color Constants for GetLockedPixel 
Author Message
 Color Constants for GetLockedPixel

For maximum efficiency DirectX just uses the real values that are stored in
the card memory. You'll have to use DDPIXELFORMAT to decode these values (as
shown at my site http://www.*-*-*.com/

Another option would be to use the GetPixel Win32 API call (suffering from a
performance hit especially if you need to do this frequently)...

Note that you could also compute where the mouse is instead of using a
mousemap...

--
Patrice Scribe
http://www.*-*-*.com/
DirectX Programming with Visual Basic



Quote:
> It seems that the VB Color Constants don't match the return value for the
> GetLockedPixel function. I have a mask bitmap with blue, red, yellow,
green,
> and white in it (see attached) and I'm trying to detect the color of the
> pixel the mouse is over. I get the following return values from the
> function: 31, 2016, 27336, 63488, 65504, 65535 and (rarely, althought I
> can't figure out why) 27336. The bitmap is 24bpp and I'm running with 16
bit
> color. My best guesses as to the matchups are:

> 31 - Blue
> 2016 - Green
> 63488 - Red
> 65504 - Yellow
> 65535 - White
> 27336 - ? (can't figure this one out since there's only 5 colors in the
> bitmap!)

> Is this correct? Is there any documentation for the constants for colors?
> Any help would be appreciated.

> Thanks in advance.

> Jim Perry
> Breakaway Games



Sat, 16 Nov 2002 03:00:00 GMT  
 Color Constants for GetLockedPixel
Better try http://www.chez.com/scribe/en/ddraw_pixelformat.htm

--
Patrice Scribe
http://members.xoom.com/vba51
DirectX Programming with Visual Basic



Quote:
> For maximum efficiency DirectX just uses the real values that are stored
in
> the card memory. You'll have to use DDPIXELFORMAT to decode these values
(as
> shown at my site http://members.xoom.com/vba51/en/pixelformat.htm

> Another option would be to use the GetPixel Win32 API call (suffering from
a
> performance hit especially if you need to do this frequently)...

> Note that you could also compute where the mouse is instead of using a
> mousemap...

> --
> Patrice Scribe
> http://members.xoom.com/vba51
> DirectX Programming with Visual Basic



> > It seems that the VB Color Constants don't match the return value for
the
> > GetLockedPixel function. I have a mask bitmap with blue, red, yellow,
> green,
> > and white in it (see attached) and I'm trying to detect the color of the
> > pixel the mouse is over. I get the following return values from the
> > function: 31, 2016, 27336, 63488, 65504, 65535 and (rarely, althought I
> > can't figure out why) 27336. The bitmap is 24bpp and I'm running with 16
> bit
> > color. My best guesses as to the matchups are:

> > 31 - Blue
> > 2016 - Green
> > 63488 - Red
> > 65504 - Yellow
> > 65535 - White
> > 27336 - ? (can't figure this one out since there's only 5 colors in the
> > bitmap!)

> > Is this correct? Is there any documentation for the constants for
colors?
> > Any help would be appreciated.

> > Thanks in advance.

> > Jim Perry
> > Breakaway Games



Sat, 16 Nov 2002 03:00:00 GMT  
 Color Constants for GetLockedPixel
Thanks for the help. It seems that doing the calculations would be more
difficult than using the mask. If you would happen to have a function handy
that would do it I wouldn't object. :)

Quote:

>For maximum efficiency DirectX just uses the real values that are stored in
>the card memory. You'll have to use DDPIXELFORMAT to decode these values
(as
>shown at my site http://members.xoom.com/vba51/en/pixelformat.htm

>Another option would be to use the GetPixel Win32 API call (suffering from
a
>performance hit especially if you need to do this frequently)...

>Note that you could also compute where the mouse is instead of using a
>mousemap...

>--
>Patrice Scribe
>http://members.xoom.com/vba51
>DirectX Programming with Visual Basic



Sat, 16 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Color constant of Titlebar gradient end color??

2. Color constant of Titlebar gradient end color??

3. Color constant of Titlebar gradient end color??

4. Sticky Notes color constants

5. System.Drawing.Color.* is not constant!

6. Creating Color Constants ????

7. Windows color constants

8. Color Constants (vbRed/vbBlue etc)

9. Color constants for desktop?

10. Desktop color constants?

11. about color constants

12. constants in terms of other constants

 

 
Powered by phpBB® Forum Software