[PATCH 2/2] comctl32: Paint 32-bpp bitmaps with an alpha channel using GdiAlphaBlend.

Dmitry Timoshkov dmitry at baikal.ru
Fri May 31 05:50:01 CDT 2019


Alexandre Julliard <julliard at winehq.org> wrote:

> >> It's not clear that an alpha channel is even meaningful with a DDB, did
> >> you test that case?
> >
> > The app loads the bitmap using LoadBitmap(), i.e. it gets loaded without
> > creating a DIB section, then the app assigns it to "Static" control.
> > Calling BitBlt() with that bitmap as a source and a 32-bpp DIB section
> > as a destination works just fine under Windows and Wine, and the result
> > preserves alpha. Is that what you mean with testing a DDB?
> 
> I don't particularly care about BitBlt() behavior, but I still think
> GetDIBits() is preferable, particularly since it works even if the
> bitmap is already selected in a DC.

I see, thanks for the explanation.

> My question was whether it's drawn with transparency in that case, since
> it's not really specified in which cases a DDB is considered to have an
> alpha channel.

In order to draw it with a transparency it's necessary to create a 32-bpp
DIB section, copy source bitmap bits, and use GdiAlphaBlend() with a DIB
section. Basically my patch does all of this.

-- 
Dmitry.



More information about the wine-devel mailing list