[Bug 47076] New: LoadImage with option LR_SHARED and specified resolution does loading only that icon resolution , skipping others

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Apr 25 23:44:17 CDT 2019


https://bugs.winehq.org/show_bug.cgi?id=47076

            Bug ID: 47076
           Summary: LoadImage with option LR_SHARED and specified
                    resolution does loading only that icon resolution,
                    skipping others
           Product: Wine
           Version: 4.6
          Hardware: x86
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: -unknown
          Assignee: wine-bugs at winehq.org
          Reporter: nikolaysemenkov at gmail.com
      Distribution: ---

LoadImage with option LR_SHARED and specified resolution(eg 32x32) does loading
only that icon resolution, skipping others. Next time loading the same resource
with all resolutions(by specifying 0,0) does return only the previously loaded
resolution, skipping others. Putting that icon on a button makes button image
giant due to wrong resolution.

eg:
HICON hIconBig = (HICON)LoadImage(HInstance, MAKEINTRESOURCE(iIconLarge),
IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR | LR_SHARED);
Loads and cache only 32x32 image

LoadImage(LGetHInstance(), MAKEINTRESOURCE(iIconSmall), IMAGE_ICON, 16, 16,
LR_DEFAULTCOLOR | LR_SHARED)
Returns 32x32 from cache instead of 16x16

HICON hIcon2 = (HICON)LoadImage(HInstance, MAKEINTRESOURCE(iIconLarge),
IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_SHARED);
Returns the 32x32 image, even though the icon(.ico resource) has images with
other resolution.

To reproduce - load an icon from a resource with the resolution and LR_SHARED
using the code above, then put it on a button and see the size (or see the size
in a debugger).

This bug does not happen on windows.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list