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

Dmitry Timoshkov dmitry at baikal.ru
Fri May 31 07:27:46 CDT 2019


Dmitry Timoshkov <dmitry at baikal.ru> wrote:

> Alexandre Julliard <julliard at winehq.org> wrote:
> 
> > >> 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.
> > 
> > Yes of course. My question was whether on Windows it's drawn transparent
> > even for the DDB case. I guess the answer is yes since you have an app
> > that does this, but a small test case wouldn't hurt.
> 
> I just added the code to my test app to draw a bitmap with BitBlt()
> loaded with LoadBitmap() (instead of assigning it to the Static control),
> and the result is drawn without transparency under Windows.

On the other hand using GdiAlphaBlend() instead of BitBlt() gives a very
nicely looking image. So it's not necessary to create a copy of the source
bitmap in the first place, but it's still necessary to verify that the bitmap
has an alpha channel in order to use correct API for drawing.

-- 
Dmitry.



More information about the wine-devel mailing list