BmpCaptionBackground.h
上传用户:kssdz899
上传日期:2007-01-08
资源大小:79k
文件大小:1k
- #ifndef BMP_CAPTION_BACKGROUND
- #define BMP_CAPTION_BACKGROUND
- /////////////////////////////////////////////////////////////////
- // Example of customising CCaptionBackground to pain a bitmap
- // as the caption background.
- //
- // Just derive from CCaptionBackground and override the Paint method.
- //
- // Construct CCaptionBmpPainter passing the path of the bmp file
- // to be displayed as the active caption background, and a BOOL
- // value to indicate whether to stretch the bitmap to fit the
- // caption (it will stretch by default if not specified).
- //
- // Author: Dave Lorde (dlorde@cix.compulink.co.uk)
- //
- // Copyright January 2000
- //
- #include "..CustomCaptionCaptionBackground.h"
- #include "Dib.h" // Device-independent bitmap handler
- class CBmpCaptionBackground : public CCaptionBackground
- {
- public:
- CBmpCaptionBackground(const char* bmpPath, BOOL stretch = TRUE);
- CBmpCaptionBackground(const CBmpCaptionBackground& bcb);
- boolean SetBitmap (const char* bmpPath);
- void SetStretch (boolean stretch);
- CString GetPath () const;
- boolean IsValid () const;
- void Paint(CDC* pDC, CSize paintArea, BOOL active);
- private:
- CDib m_Dib;
- CString m_Path;
- BOOL m_Valid;
- BOOL m_Stretch;
- void PaintBitmap(CDC* pDC, CSize paintArea);
- };
- #endif