summaryrefslogtreecommitdiff
path: root/plugins/MirandaG15/src/LCDFramework/CLCDBitmap.cpp
blob: 7fdb18866ab3288db55ca778c5b80992698d5682 (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
#include "stdafx.h"
#include "CLCDBitmap.h"

CLCDBitmap::CLCDBitmap()
{
}

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(nullptr != hBitmap);
	m_hBitmap = hBitmap;
}