[Bug 2733] New: transparency in LoadImage() or in static controls

Wine Bugs wine-bugs at winehq.org
Wed Feb 16 08:10:02 CST 2005


http://bugs.winehq.org/show_bug.cgi?id=2733

           Summary: transparency in LoadImage() or in static controls
           Product: Wine
           Version: 20041019
          Platform: PC
               URL: http://msdn.microsoft.com/library/default.asp?url=/libra
                    ry/en-
                    us/winui/winui/windowsuserinterface/resources/introducti
                    ontoresources/resourcereference/resourcefunctions/loadim
                    age.asp
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: wine-gdi
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: tenbergemh at yahoo.com


In my application, I use transparency for bitmaps. This doesn't seem to work in
Wine.

I load the bitmaps with LoadImage:
handle = LoadImage(hInstance, "logo", IMAGE_BITMAP, 0, 0,
LR_LOADTRANSPARENT|LR_LOADTRANSPARENT);
and display them with a static control:
win = CreateWindow("STATIC", "logo", WS_VISIBLE|WS_CHILD|SS_BITMAP, 5, 5, 1, 1,
parent, (HMENU)ID_PASV, mainInstance, (LPVOID) NULL);
SendMessage(win, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)handle);

---<quote>--- from the win32 api reference:
LR_LOADTRANSPARENT
    Retrieves the color value of the first pixel in the image and replaces the
corresponding entry in the color table with the default window color
(COLOR_WINDOW). All pixels in the image that use that entry become the default
window color. This value applies only to images that have corresponding color
tables.

    Do not use this option if you are loading a bitmap with a color depth
greater than 8bpp.

    If fuLoad includes both the LR_LOADTRANSPARENT and LR_LOADMAP3DCOLORS
values, LRLOADTRANSPARENT takes precedence. However, the color table entry is
replaced with COLOR_3DFACE rather than COLOR_WINDOW.
---</quote>---

The bitmap is 8bpp, the upper-left pixel's color is white, the color to be
replaced with transparency. The color map contains 2 entries: 0=orange, 1=white.

Expected (tested on Win2K and Win95):
1) with only the option 'LR_LOADTRANSPARENT': The white of the bitmap is
replaced with COLOR_WINDOW, which I had set to red instead of the standard white
to see the effect.
2) with options 'LR_LOADTRANSPARENT|LR_LOADMAP3DCOLORS': The white of the bitmap
is replaced with COLOR_3DFACE, which defaulted to middle-gray.

Observed (wine):
In both cases the white of the bitmap is also displayed as white.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list