//Remember to add these to the linker: msimg32.lib winmm.lib
#pragma once
#include <windows.h>
#include <stdio.h>		// for memset
#include <fstream>

class Bitmap
{
public:
					Bitmap		();
					Bitmap		(HDC hDC, LPTSTR szFileName);
					Bitmap		(HDC hDC, UINT uiResID, HINSTANCE hInstance);
					Bitmap		(HDC hDC, int iWidth, int iHeight, COLORREF crColor = RGB(0, 0, 0));
	virtual			~Bitmap		();
	BOOL			Create		(HDC hDC, LPTSTR szFileName);
	BOOL			Create		(HDC hDC, UINT uiResID, HINSTANCE hInstance);
	BOOL			Create		(HDC hDC, int iWidth, int iHeight, COLORREF crColor);
	virtual void	Draw		(HDC hDC, int x, int y, BOOL bTrans , COLORREF crTransColor = RGB(255, 0, 255));
	void			DrawPart	(HDC hDC, int x, int y, int xPart, int yPart, int wPart, int hPart, 
									BOOL bTrans, COLORREF crTransColor = RGB(255, 0, 255));
	int				GetWidth	() const { return m_iWidth;	};
	int				GetHeight	() const { return m_iHeight; };

protected:
	HBITMAP			m_hBitmap;
	int				m_iWidth;
	int				m_iHeight;

	void			Free();
};