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 "Rainmeter.h"
#include "Error.h"
#include "../Common/Gfx/Canvas.h"
extern CRainmeter* Rainmeter;
@ -181,18 +182,22 @@ bool CMeterButton::Update()
** Draws the meter on the double buffer
**
*/
bool CMeterButton::Draw(Graphics& graphics)
bool CMeterButton::Draw(Gfx::Canvas& canvas)
{
if (!CMeter::Draw(graphics)) return false;
if (!CMeter::Draw(canvas)) return false;
if (m_Bitmaps[m_State] == NULL) return false; // Unable to continue
Gdiplus::Graphics& graphics = canvas.BeginGdiplusContext();
int x = GetX();
int y = GetY();
// Blit the image
graphics.DrawCachedBitmap(m_Bitmaps[m_State], x, y);
canvas.EndGdiplusContext();
return true;
}