mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
- Fixed Background=*.png issue: http://rainmeter.net/forum/viewtopic.php?f=5&t=8596
- Performance improvement on BitmapToRegion function.
This commit is contained in:
@ -399,8 +399,8 @@ void CMeterWindow::Refresh(bool init, bool all)
|
||||
|
||||
// Set the window region
|
||||
CreateRegion(true); // Clear the region
|
||||
if (init) ShowWindow(m_Window, SW_SHOWNOACTIVATE);
|
||||
Update(false);
|
||||
CreateRegion(false);
|
||||
|
||||
if (m_KeepOnScreen)
|
||||
{
|
||||
@ -2652,10 +2652,18 @@ void CMeterWindow::CreateRegion(bool clear)
|
||||
m_DoubleBuffer->GetHBITMAP(Color(255,0,255), &background);
|
||||
if (background)
|
||||
{
|
||||
HRGN region = BitmapToRegion(background, RGB(255,0,255), 0x101010, 0, 0);
|
||||
HRGN region = BitmapToRegion(background, RGB(255,0,255), 0x101010);
|
||||
SetWindowRgn(m_Window, region, TRUE);
|
||||
DeleteObject(background);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowRgn(m_Window, NULL, TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWindowRgn(m_Window, NULL, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2672,7 +2680,6 @@ void CMeterWindow::Redraw()
|
||||
if (m_ResetRegion)
|
||||
{
|
||||
ResizeWindow(false);
|
||||
CreateRegion(true);
|
||||
}
|
||||
|
||||
// Create or clear the doublebuffer
|
||||
@ -2768,8 +2775,11 @@ void CMeterWindow::Redraw()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_ResetRegion) CreateRegion(false);
|
||||
m_ResetRegion = false;
|
||||
if (m_ResetRegion || !m_BackgroundName.empty())
|
||||
{
|
||||
CreateRegion(false);
|
||||
m_ResetRegion = false;
|
||||
}
|
||||
|
||||
UpdateTransparency(m_TransparencyValue, false);
|
||||
|
||||
|
Reference in New Issue
Block a user