1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #if !defined(AFX_BitmapEx_H__73EF928E_90A7_461A_B879_7E3007684679__INCLUDED_)
- #define AFX_BitmapEx_H__73EF928E_90A7_461A_B879_7E3007684679__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif
- class CBitmapEx : public CBitmap
- {
- public:
- BOOL Draw(CDC *pDC, LPRECT r, int pos);
- void TransParentDraw(CDC *pDC, CRect rc, COLORREF col);
- BOOL LoadImage(LPCTSTR szImagePath, COLORREF crBack = 0);
- BOOL LoadImage(UINT uIDRes, LPCTSTR szResourceType, HMODULE hInst = NULL, COLORREF crBack = 0);
-
- static BOOL GetResource(LPCTSTR lpName, LPCTSTR lpType, HMODULE hInst, void* pResource, int& nBufSize);
- static IPicture* LoadFromBuffer(BYTE* pBuff, int nSize);
- BOOL Draw( CDC *pDC, LPRECT r);
-
- BOOL Draw( CDC *pDC, int x, int y, LPRECT sr );
- BOOL Draw( CDC *pDC, int x, int y, LPRECT sr, COLORREF colTrans, BOOL bTrans );
- BOOL StretchDraw(CDC *pDC, LPRECT tr, LPRECT sr );
- BOOL StretchDraw(CDC *pDC, LPRECT r);
- BOOL StretchDraw2(CDC *pDC, LPRECT r);
- int Width()
- {
- return GetWidth();
- }
-
- int GetWidth()
- {
- BITMAP bm;
- memset( &bm, 0, sizeof(bm) );
- GetBitmap(&bm);
- return bm.bmWidth;
- }
- int Height()
- {
- return GetHeight();
- }
-
- int GetHeight()
- {
- BITMAP bm;
- memset( &bm, 0, sizeof(bm) );
- GetBitmap(&bm);
- return bm.bmHeight;
- }
-
- CBitmapEx();
- virtual ~CBitmapEx();
- BOOL Attach(IPicture* pPicture, COLORREF crBack);
- BOOL Attach( HBITMAP hbmp )
- {
- return CBitmap::Attach( hbmp );
- }
-
-
- BOOL DrawTransparent(CDC * pDC, int x, int y, COLORREF crColour);
- HRGN CreateRgnFromFile( COLORREF color );
- };
- #endif
|