DIBPal.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:1k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1998-1999 DXGuide. All Rights Reserved.
- // File: DIBPal.h
- #ifndef _DIBPAL__H
- #define _DIBPAL__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- // turn off warnings for /W4
- #pragma warning(disable: 4201)
- #include <mmsystem.h>
- #pragma warning(default: 4201)
- class CDIB;
- class CPackFileManager;
- class CDIBPal : public CPalette
- {
- public:
- CDIBPal(void);
- ~CDIBPal();
- public:
- // Create a new palette;
- bool Create(CDIB const* pDIB); // create from a DIB
- bool Create(BITMAPINFO const* pBMI); // create from color table
- bool Create(RGBQUAD const* pRGB, int nColors); // create from clr table
- public:
- void Draw(HDC hDC, RECT* pRect, bool bBkgnd = false);
- // Create an identity palette.
- bool SetSysPalColors(void);
- // Load a palette from a file.
- bool Load(LPCTSTR pszFilename = NULL,
- CPackFileManager* pPackFileManager = NULL);
- bool Load(CFile* fp);
- bool Load(UINT hFile);
- bool Load(HMMIO hmmio);
- bool LoadResource(WORD wID, LPCTSTR lpType = NULL);
- // Save the palette to a file.
- bool Save(LPCTSTR pszFilename = NULL);
- bool Save(CFile* fp);
- bool Save(UINT hFile);
- bool Save(HMMIO hmmio);
- // Create a color cube wash palette.
- bool CreateWash(void);
- // Create a palette from the 20 system reserved colors.
- bool CreateSystemColorPalette(void);
- public:
- static const LPCTSTR m_lpcszDefaultPalTypeName;
- };
- #endif // _DIBPAL__H