Re: Map dithered color to nearest solid in 256 color mode?
From: Tom Esh (tjeshGibberish_at_earthlink.net)
Date: 11/17/04
- Next message: MikeD: "Re: using window's handle or process id to get the path from an opened"
- Previous message: Tony Proctor: "Re: using window's handle or process id to get the path from an opened"
- In reply to: Joseph Geretz: "Map dithered color to nearest solid in 256 color mode?"
- Next in thread: Joseph Geretz: "Re: Map dithered color to nearest solid in 256 color mode?"
- Reply: Joseph Geretz: "Re: Map dithered color to nearest solid in 256 color mode?"
- Reply: Joseph Geretz: "Re: Map dithered color to nearest solid in 256 color mode?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 17 Nov 2004 14:12:15 -0500
On Wed, 17 Nov 2004 12:50:17 -0500, "Joseph Geretz"
<jgeretz@nospam.com> wrote:
>Our application implements a colored background, rather than the standard
>'battleship grey'. Normally, the application runs in a high-color mode and
>the forms look just fine. However, when the application is run in 256 color
>mode, the background is dithered and it doesn't look very nice.
>
>First question: Is there a way to set our forms up in the IDE to specify
>that the color should map to the nearest solid when running under 256 color
>mode? This would be the easiest solution.
>
>If not, I guess I can use the API to do this manually. I'll need to know how
>to detect the current color mode and then how to map a dithered color into
>the nearest solid color.
You could use GetNearestColor ...or let Ole do it for you when it
translates the value. Bit# 25 (value &H2000000) is the "no-dither"
flag.
Private Const OLE_NODITHER = &H2000000 'bit #25= no dither
ex:
Me.BackColor = RGB(217, 171, 87) Or OLE_NODITHER
You can also set the corresponding combined hex value directly in the
properties window at design time, though I would not recommend it. The
prop window color selector does not provide a way to set the flag
which makes it all to easy to strip it.
-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
- Next message: MikeD: "Re: using window's handle or process id to get the path from an opened"
- Previous message: Tony Proctor: "Re: using window's handle or process id to get the path from an opened"
- In reply to: Joseph Geretz: "Map dithered color to nearest solid in 256 color mode?"
- Next in thread: Joseph Geretz: "Re: Map dithered color to nearest solid in 256 color mode?"
- Reply: Joseph Geretz: "Re: Map dithered color to nearest solid in 256 color mode?"
- Reply: Joseph Geretz: "Re: Map dithered color to nearest solid in 256 color mode?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|