-
-
Notifications
You must be signed in to change notification settings - Fork 208
/
BitmapHelper.h
31 lines (24 loc) · 1.1 KB
/
BitmapHelper.h
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
// BitmapHelper.h: interface for the CBitmapHelper class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BITMAPHELPER_H__641D941B_5487_4F85_BFC1_012F2083A8B6__INCLUDED_)
#define AFX_BITMAPHELPER_H__641D941B_5487_4F85_BFC1_012F2083A8B6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
class CBitmapHelper
{
public:
CBitmapHelper();
virtual ~CBitmapHelper();
static int GetCBitmapWidth(const CBitmap & cbm);
static int GetCBitmapHeight(const CBitmap & cbm);
static BOOL GetCBitmap(void *pClip2, CDC *pDC, CBitmap *pBitMap, int nMaxHeight);
static BOOL GetCBitmap(CClipFormats&clips, CDC* pDC, CBitmap* pBitMap, BOOL horizontal);
static HANDLE hBitmapToDIB(HBITMAP hBitmap, DWORD dwCompression, HPALETTE hPal);
static WORD PaletteSize(LPSTR lpDIB);
static WORD DIBNumColors(LPSTR lpDIB);
static bool DrawDIB(CDC *pDC, HANDLE hData, int nLeft, int nRight, int &nWidth);
};
#endif // !defined(AFX_BITMAPHELPER_H__641D941B_5487_4F85_BFC1_012F2083A8B6__INCLUDED_)