summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/src/LCDFramework/CLCDBitmap.cpp
blob: 5ce448769d45e365745a9891e5d3581a82e7a45d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "stdafx.h"
#include "CLCDBitmap.h"

CLCDBitmap::CLCDBitmap()
{
	m_hBitmap = NULL;
}

CLCDBitmap::~CLCDBitmap()
{
}

bool CLCDBitmap::Initialize()
{
	return true;
}

bool CLCDBitmap::Shutdown()
{
	return true;
}

bool CLCDBitmap::Update()
{
	return true;
}

bool CLCDBitmap::Draw(CLCDGfx *pGfx)
{
	if(m_hBitmap)
    {
        HDC hCompatibleDC = CreateCompatibleDC(pGfx->GetHDC());
        HBITMAP hOldBitmap = (HBITMAP)SelectObject(hCompatibleDC, m_hBitmap);
        
        BitBlt(pGfx->GetHDC(), 0, 0, GetWidth(), GetHeight(), hCompatibleDC, 0, 0, SRCCOPY);
        
        // restores
        SelectObject(hCompatibleDC, hOldBitmap);
        DeleteDC(hCompatibleDC);
    }
	return true;
}

void CLCDBitmap::SetBitmap(HBITMAP hBitmap)
{
    ASSERT(NULL != hBitmap);
    m_hBitmap = hBitmap;
}