From: Piranha on
I have an application where the main window fills its background in
case WM_PAINT by

HBRUSH BlueBrush = CreateSolidBrush(RGB(33,63,92));
FillRect(hdcMem,&rect,BlueBrush);

Over that I load a bitmap and BitBlt() it into the center of the
window.

The bitmap was created in Paintshop in plain .bmp format and uses as
background the same RGB.

Running the program in XP looks perfect, same in Vista 32 bit, but in
Windows 7 64 bit (still the same 32 bit application) the 2 colors
appear slightly different.
The background of the window is a lille bit darker than the backround
of the bitmap.

Can anyone tell me why this is and how to fix it?
From: Alf P. Steinbach on
* Piranha, on 24.05.2010 22:55:
> I have an application where the main window fills its background in
> case WM_PAINT by
>
> HBRUSH BlueBrush = CreateSolidBrush(RGB(33,63,92));
> FillRect(hdcMem,&rect,BlueBrush);
>
> Over that I load a bitmap and BitBlt() it into the center of the
> window.
>
> The bitmap was created in Paintshop in plain .bmp format and uses as
> background the same RGB.
>
> Running the program in XP looks perfect, same in Vista 32 bit, but in
> Windows 7 64 bit (still the same 32 bit application) the 2 colors
> appear slightly different.
> The background of the window is a lille bit darker than the backround
> of the bitmap.
>
> Can anyone tell me why this is and how to fix it?

3 possibilites: (1) you have a bug, (2) the colors are actually slightly
different, or (3) Microsoft has again applied its "we know better than you what
you want" and decided to do a little photo-processing to make pictures look
better, e.g. taking into account the monitor's color response or something.

Fast googling it there is a possibility it may have something to do with Windows
7 (or is it Nvidia?) "color vibrance". Anyway, lots of hits for color problems
with Windows 7. In general it seems the practical solution is to adjust the
monitor's color settings (color profile).

Regarding (2) try to check the [.bmp] file color in MS Paint.


Cheers & hth.,

- Alf

--
blog at <url: http://alfps.wordpress.com>
From: Leo Davidson on
On May 24, 9:55 pm, Piranha <eu_pira...(a)gmx.net> wrote:
> The background of the window is a lille bit darker than the backround
> of the bitmap.

Is the source or destination bitmap using indexed colour?

If so it could be the same apparent (and very old) GDI bug that I
stumbled upon where GDI Blit etc. all seem to choose the wrong colour
when writing to an indexed colour destination, even when an exact
match is present (and no colour profile stuff is in use):

http://stackoverflow.com/questions/1957308/gdi-fails-conversion-to-indexed-color-with-exact-palette
From: Piranha on
On 25 Mai, 10:04, "Alf P. Steinbach" <al...(a)start.no> wrote:
> * Piranha, on 24.05.2010 22:55:
>
>
>
>
>
> > I have an application where the main window fills its background in
> > case WM_PAINT by
>
> > HBRUSH BlueBrush = CreateSolidBrush(RGB(33,63,92));
> > FillRect(hdcMem,&rect,BlueBrush);
>
> > Over that I load a bitmap and BitBlt() it into the center of the
> > window.
>
> > The bitmap was created in Paintshop in plain .bmp format and uses as
> > background the same RGB.
>
> > Running the program in XP looks perfect, same in Vista 32 bit, but in
> > Windows 7 64 bit (still the same 32 bit application) the 2 colors
> > appear slightly different.
> > The background of the window is a lille bit darker than the backround
> > of the bitmap.
>
> > Can anyone tell me why this is and how to fix it?
>
> 3 possibilites: (1) you have a bug, (2) the colors are actually slightly
> different, or (3) Microsoft has again applied its "we know better than you what
> you want" and decided to do a little photo-processing to make pictures look
> better, e.g. taking into account the monitor's color response or something.
>
> Fast googling it there is a possibility it may have something to do with Windows
> 7 (or is it Nvidia?) "color vibrance". Anyway, lots of hits for color problems
> with Windows 7. In general it seems the practical solution is to adjust the
> monitor's color settings (color profile).
>
> Regarding (2) try to check the [.bmp] file color in MS Paint.
>
> Cheers & hth.,
>
> - Alf
>
> --
> blog at <url:http://alfps.wordpress.com>- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

Now that you´ve given me the keyword, I see the problem, thanks,
hopefully I´ll find a solution.