diff options
Diffstat (limited to 'plugins/TabSRMM/src/themes.cpp')
-rw-r--r-- | plugins/TabSRMM/src/themes.cpp | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 4791b19699..0031803d07 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1590,7 +1590,6 @@ void CSkin::setupTabCloseBitmap(bool fDeleteOnly) return;
}
- bool fFree = false;
RECT rc = { 0, 0, 20, 20 };
HDC dc = ::GetDC(PluginConfig.g_hwndHotkeyHandler);
m_tabCloseHDC = ::CreateCompatibleDC(dc);
@@ -1621,9 +1620,12 @@ void CSkin::setupTabCloseBitmap(bool fDeleteOnly) ::DrawIconEx(m_tabCloseHDC, 2, 2, PluginConfig.g_buttonBarIcons[ICON_BUTTON_CANCEL], 16, 16, 0, nullptr, DI_NORMAL);
::SelectObject(m_tabCloseHDC, m_tabCloseOldBitmap);
- HBITMAP hbmTemp = ResizeBitmap(m_tabCloseBitmap, 16, 16, fFree);
- ::DeleteObject(m_tabCloseBitmap);
- m_tabCloseBitmap = hbmTemp;
+ HBITMAP hbmTemp = ::Image_Resize(m_tabCloseBitmap, RESIZEBITMAP_STRETCH, 16, 16);
+ if (hbmTemp != m_tabCloseBitmap) {
+ ::DeleteObject(m_tabCloseBitmap);
+ m_tabCloseBitmap = hbmTemp;
+ }
+
CImageItem::PreMultiply(m_tabCloseBitmap, 1);
m_tabCloseOldBitmap = reinterpret_cast<HBITMAP>(::SelectObject(m_tabCloseHDC, m_tabCloseBitmap));
@@ -2060,36 +2062,6 @@ int CSkin::RenderText(HDC hdc, HANDLE hTheme, const wchar_t *szText, RECT *rc, D }
/////////////////////////////////////////////////////////////////////////////////////////
-// Resize a bitmap using image service. The function does not care about the image aspect ratio.
-// The caller is responsible to submit proper values for the desired height and width.
-//
-// @param hBmpSrc HBITMAP: the source bitmap
-// @param width LONG: width of the destination bitmap
-// @param height LONG: height of the new bitmap
-// @param mustFree bool: indicates that the new bitmap had been
-//resized and either the source or destination
-//bitmap should be freed.
-//
-// @return HBTIAMP: handle to a bitmap with the desired size.
-
-HBITMAP CSkin::ResizeBitmap(HBITMAP hBmpSrc, LONG width, LONG height, bool &mustFree)
-{
- BITMAP bm;
-
- GetObject(hBmpSrc, sizeof(bm), &bm);
- if (bm.bmHeight != height || bm.bmWidth != width) {
- HBITMAP hbmNew = Image_Resize(hBmpSrc, RESIZEBITMAP_STRETCH, height, width);
- if (hbmNew != hBmpSrc)
- mustFree = true;
- return(hbmNew);
- }
- else {
- mustFree = false;
- return(hBmpSrc);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// Draw the given skin item to the target rectangle and dc
//
// @param hdc HDC: device context
|