6 #ifndef BEXTRACTOR_DIB_H
7 #define BEXTRACTOR_DIB_H
10 #pragma message ("NOTE: You can speed compilation by including <vfw.h> in stdafx.h")
19 extern CSize GetBitmapSize(CBitmap* pBitmap);
20 extern BOOL DrawBitmap(CDC& dc, CBitmap* pBitmap,
21 const CRect* rcDst=NULL,
const CRect* rcSrc=NULL);
26 class CDib :
public CBitmap
44 bool Setup(CDC* pDC,
int width,
int height,
int bits_per_pixel,
45 HDRAWDIB hdd,
RGBQUAD *colors = NULL);
47 bool Setup(CDC* pDC, GDALDataset *pDataset, HDRAWDIB hdd,
48 bool progress_callback(
int) = NULL);
50 CSize GetSize() {
return CSize(m_bm.bmWidth, m_bm.bmHeight); }
51 BOOL Attach(HGDIOBJ hbm);
52 BOOL Load(LPCTSTR szPathName);
53 BOOL Load(HINSTANCE hInst, LPCTSTR lpResourceName);
54 BOOL Load(HINSTANCE hInst, UINT uID)
55 {
return Load(hInst, MAKEINTRESOURCE(uID)); }
58 BOOL Draw(CDC& dc,
const CRect* rcDst=NULL,
const CRect* rcSrc=NULL,
59 BOOL bUseDrawDib=TRUE, CPalette* pPal=NULL, BOOL bForeground=FALSE);
61 void GetDIBFromSection();
63 BOOL CreatePalette(CPalette& pal);
64 CPalette* GetPalette() {
return &m_pal; }
66 UINT GetColorTable(
RGBQUAD* colorTab, UINT nColors);
68 void SetPixel24(
int x,
int y,
const RGBQUAD &rgb);
69 void GetPixel24(
int x,
int y,
RGBQUAD &rgb);
70 byte GetPixel8(
int x,
int y);
71 void SetPixel8(
int x,
int y, byte val);
72 int GetWidth() {
return m_bm.bmWidth; }
73 int GetHeight() {
return m_bm.bmHeight; }
75 char *GetData() {
return (
char *) m_data; }
78 CDib *CreateMonoDib(CDC *pDC,
CDib *pDib, HDRAWDIB hdd,
bool progress_callback(
int) = NULL);
80 #endif // BEXTRACTOR_DIB_H