Applied the Rorix's image meter patch which makes it possible to define the path to the image location.

This commit is contained in:
Kimmo Pekkola 2009-07-24 08:08:52 +00:00
parent a7c6c939ac
commit a588a86b3b
2 changed files with 12 additions and 2 deletions

View File

@ -178,7 +178,16 @@ void CMeterImage::ReadConfig(const WCHAR* section)
CConfigParser& parser = m_MeterWindow->GetParser();
m_ImageName = parser.ReadString(section, L"ImageName", L"");
m_ImageName = m_MeterWindow->MakePathAbsolute(m_ImageName);
m_Path = parser.ReadString(section, L"Path", L"");
if (!m_Path.empty())
{
if (m_Path[m_Path.length() - 1] != L'\\')
{
m_Path += L"\\";
}
}
m_ImageName = m_MeterWindow->MakePathAbsolute(m_Path + m_ImageName);
if (-1 != parser.ReadInt(section, L"W", -1) && -1 != parser.ReadInt(section, L"H", -1))
{
@ -200,7 +209,7 @@ bool CMeterImage::Update()
if (!val.empty())
{
// Load the new image
val = m_MeterWindow->MakePathAbsolute(val);
val = m_MeterWindow->MakePathAbsolute(m_Path + val);
if (val != m_ImageName)
{
m_ImageName = val;

View File

@ -44,6 +44,7 @@ private:
Gdiplus::Bitmap* m_Bitmap; // The bitmap
std::wstring m_ImageName; // Name of the image
std::wstring m_Path;
bool m_DimensionsDefined;
HGLOBAL m_hBuffer;
FILETIME m_Modified;