diff options
author | George Hazan <ghazan@miranda.im> | 2019-04-13 20:22:59 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-04-13 20:22:59 +0300 |
commit | 680873487c4a7987012606119a744e5ca725ad30 (patch) | |
tree | 8e5fbc68a253c3ec44287754c9295670f1ee44c3 /plugins/MenuItemEx/src/images.cpp | |
parent | 6c4136504c660bf3359e6641362672c4b9502be5 (diff) |
merge with trunk
Diffstat (limited to 'plugins/MenuItemEx/src/images.cpp')
-rw-r--r-- | plugins/MenuItemEx/src/images.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/plugins/MenuItemEx/src/images.cpp b/plugins/MenuItemEx/src/images.cpp index f59b4c2c4e..4d2189a8d9 100644 --- a/plugins/MenuItemEx/src/images.cpp +++ b/plugins/MenuItemEx/src/images.cpp @@ -304,33 +304,30 @@ HICON MakeHalfAlphaIcon(HICON SourceIcon) //}
-HICON BindOverlayIcon(HICON SourceIcon, LPCSTR OverlayIconName)
+HICON BindOverlayIcon(HICON SourceIcon, int iIcon)
{
+ HICON TempIcon = CopyIcon(SourceIcon);
ICONINFO OverlayIconInfo, TargetIconInfo;
- BITMAP OverlayBitmapInfo, TargetBitmapInfo;
- HBITMAP OldOverlayBitmap, OldTargetBitmap;
- HICON OverlayIcon, TargetIcon, TempIcon;
- HDC OverlayDC, TargetDC;
- BLENDFUNCTION bf = { 0, 0, 255, 1 };
-
- TempIcon = CopyIcon(SourceIcon);
if (!GetIconInfo(TempIcon, &TargetIconInfo))
return nullptr;
MakeBitmap32(&TargetIconInfo.hbmColor);
CorrectBitmap32Alpha(TargetIconInfo.hbmColor, FALSE);
+
+ BITMAP OverlayBitmapInfo, TargetBitmapInfo;
GetObject(TargetIconInfo.hbmColor, sizeof(BITMAP), &TargetBitmapInfo);
- OverlayIcon = IcoLib_GetIcon(OverlayIconName);
+ HICON OverlayIcon = g_plugin.getIcon(iIcon);
if (!GetIconInfo(OverlayIcon, &OverlayIconInfo) || !GetObject(OverlayIconInfo.hbmColor, sizeof(BITMAP), &OverlayBitmapInfo))
return nullptr;
- TargetDC = CreateCompatibleDC(nullptr);
- OldTargetBitmap = (HBITMAP)SelectObject(TargetDC, TargetIconInfo.hbmColor);
+ HDC TargetDC = CreateCompatibleDC(nullptr);
+ HBITMAP OldTargetBitmap = (HBITMAP)SelectObject(TargetDC, TargetIconInfo.hbmColor);
- OverlayDC = CreateCompatibleDC(nullptr);
- OldOverlayBitmap = (HBITMAP)SelectObject(OverlayDC, OverlayIconInfo.hbmColor);
+ HDC OverlayDC = CreateCompatibleDC(nullptr);
+ HBITMAP OldOverlayBitmap = (HBITMAP)SelectObject(OverlayDC, OverlayIconInfo.hbmColor);
+ BLENDFUNCTION bf = { 0, 0, 255, 1 };
AlphaBlend(TargetDC, 0, 0, TargetBitmapInfo.bmWidth, TargetBitmapInfo.bmHeight,
OverlayDC, 0, 0, OverlayBitmapInfo.bmWidth, OverlayBitmapInfo.bmHeight, bf);
@@ -340,9 +337,8 @@ HICON BindOverlayIcon(HICON SourceIcon, LPCSTR OverlayIconName) BitBlt(TargetDC, 0, 0, TargetBitmapInfo.bmWidth, TargetBitmapInfo.bmHeight,
OverlayDC, 0, 0, SRCCOPY);
- TargetIcon = CreateIconIndirect(&TargetIconInfo);
+ HICON TargetIcon = CreateIconIndirect(&TargetIconInfo);
DestroyIcon(TempIcon);
- //DestroyIcon(OverlayIcon);
SelectObject(TargetDC, OldTargetBitmap);
DeleteObject(TargetIconInfo.hbmColor);
|