Change to use Gfx rendering

This commit is contained in:
Birunthan Mohanathas
2013-03-25 17:42:18 +02:00
parent 82970d1cce
commit ef1cf223a7
22 changed files with 226 additions and 582 deletions

View File

@ -21,6 +21,7 @@
#include "Measure.h"
#include "Error.h"
#include "Rainmeter.h"
#include "../Common/Gfx/Canvas.h"
using namespace Gdiplus;
@ -410,12 +411,14 @@ bool CMeterHistogram::Update()
** Draws the meter on the double buffer
**
*/
bool CMeterHistogram::Draw(Graphics& graphics)
bool CMeterHistogram::Draw(Gfx::Canvas& canvas)
{
if (!CMeter::Draw(graphics) ||
if (!CMeter::Draw(canvas) ||
(m_Measures.size() >= 1 && !m_PrimaryValues) ||
(m_Measures.size() >= 2 && !m_SecondaryValues)) return false;
Gdiplus::Graphics& graphics = canvas.BeginGdiplusContext();
CMeasure* secondaryMeasure = (m_Measures.size() >= 2) ? m_Measures[1] : NULL;
GraphicsPath primaryPath;
@ -633,6 +636,8 @@ bool CMeterHistogram::Draw(Graphics& graphics)
}
}
canvas.EndGdiplusContext();
return true;
}