home *** CD-ROM | disk | FTP | other *** search
- // -------------------------------------------------------------------------
- // Copyright @ 1997 TCK Software, Incorporated
- // All Rights Reserved
- // -------------------------------------------------------------------------
- #ifndef __VBITMAP_H__
- #define __VBITMAP_H__
-
- #ifdef VF_STATIC
- #undef AFX_EXT_CLASS
- #define AFX_EXT_CLASS
- #endif
-
- // -------------------------------------------------------------------------
- // Extended CBitmap
- // - automatically creates and uses a palette
- // - in the simplest sense - always realizes the palette in the background
- // -------------------------------------------------------------------------
- class AFX_EXT_CLASS VBitmap : public CBitmap
- {
- protected:
- DECLARE_DYNAMIC(VBitmap)
-
- CPalette m_pal; // palette
- BITMAP m_bm; // bitmap info
-
- public:
- VBitmap();
- ~VBitmap();
-
- CPalette* GetPalette() { return &m_pal; }
- HPALETTE GetPaletteHandle() { return m_pal; }
- BITMAP GetBitmapInfo() { return m_bm; }
-
- BOOL LoadFile(LPCTSTR szFile);
- BOOL LoadRes(LPCTSTR szResourceName);
- BOOL LoadRes(UINT uID) { return LoadRes(MAKEINTRESOURCE(uID)); }
-
- BOOL Attach(HBITMAP hBitmap); // like CBitmap::Attach
- // but creates the palette
- BOOL CreatePalette(CPalette& pal); // Creates the palette
- UINT GetColorTable(RGBQUAD* colorTable, UINT nColors);
-
- BOOL Draw(CDC* pDC, const CRect* pRectDest=NULL,
- const CRect* pRectSrc=NULL, CPalette* pPal=NULL);
- BOOL DrawTiled(CDC* pDC, const CRect* pRectDest=NULL,
- const CRect* pRectSrc=NULL, CPalette* pPal=NULL);
-
- BOOL DeleteObject(); // Resets palette and info
- };
-
- #endif
-