From a588a86b3bbc073784c593ac1ef8e30a9114802c Mon Sep 17 00:00:00 2001 From: Kimmo Pekkola Date: Fri, 24 Jul 2009 08:08:52 +0000 Subject: [PATCH] Applied the Rorix's image meter patch which makes it possible to define the path to the image location. --- Library/MeterImage.cpp | 13 +++++++++++-- Library/MeterImage.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Library/MeterImage.cpp b/Library/MeterImage.cpp index f1aeeb5c..d7c5abe4 100644 --- a/Library/MeterImage.cpp +++ b/Library/MeterImage.cpp @@ -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; diff --git a/Library/MeterImage.h b/Library/MeterImage.h index b495acd1..76835a25 100644 --- a/Library/MeterImage.h +++ b/Library/MeterImage.h @@ -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;