"Sergey Bogdanov" <sergey.bogdanov@gmail.com> wrote in message
news:OHLC4TmFFHA.3840@tk2msftngp13.phx.gbl...
> So it will get like disabled, convert a certain Image as grayscale by
> computing Y value (is the grayscale component in YIQ) by this formula:
>
> Y = 0.299 * R + 0.587 * G + 0.114 * B
>
> and then use Y value as R, G, B parameters for a color. See the code
> snippet bellow, "dst" variable will contain grayscale image from "source"
> bitmap:
>
> Bitmap dst = new Bitmap(source.Width, source.Height);
>
> for(int y=0; y < dst.Height;y++)
> {
> for(int x=0; x < dst.Width; x++)
> {
> Color c = source.GetPixel(x, y);
> // alternatively Y = (77 * c.R + 150 * c.G + 29 * c.B) >> 8
> int Y = (int)(c.R * 0.299 + c.G * 0.587 + c.B * 0.114);
> dst.SetPixel(x, y, Color.FromArgb(Y, Y, Y));
> }
> }
>
>
> Hope this help,
> Sergey Bogdanov
>
http://www.sergeybogdanov.com >
>
> Dan wrote:
>> Hi everyone
>>
>> Does anyone know how to draw an image in a disabled state on the compact
>> framework?
>> I have created a dropdown button akin to the forward and back button in
>> IE
>> but I'm stuck when it comes to putting the button in a disabled state.
>>
>> Any help would be much appreciated.
>> Thanks in advance
>> Dan
>>