123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- #ifndef IMAGE_HEAD_FILE
- #define IMAGE_HEAD_FILE
- #pragma once
- class CImageEx
- {
-
- protected:
- Bitmap * m_pImage;
- TCHAR m_strImageName[MAX_PATH];
- RECT m_rcNinePart;
- HBITMAP m_hBitmap;
-
- public:
-
- CImageEx();
-
- virtual ~CImageEx();
-
- public:
-
- bool IsNull();
-
- INT GetWidth();
-
- INT GetHeight();
-
- public:
-
- void SetNinePart(CONST LPRECT lprcNinePart);
-
- HBITMAP ImageToBitmap(/*HDC hDC*/);
-
- bool SetGray();
-
- public:
-
- bool DestroyImage();
-
- bool LoadImage(LPCTSTR pszFileName);
-
- bool LoadImage(HINSTANCE hInstance, LPCTSTR pszResourceName,LPCTSTR pszResourceType=TEXT("IMAGE"));
-
- public:
-
- bool DrawImage(CDC * pDC, INT nXPos, INT nYPos);
-
- bool DrawImage(CDC * pDC, INT nXPos, INT nYPos, INT nDestWidth, INT nDestHeight);
-
- bool DrawImage(CDC * pDC, RECT &rc);
-
- bool DrawImage(CDC * pDC, INT nXDest, INT nYDest, INT nDestWidth, INT nDestHeight, INT nXScr, INT nYSrc);
-
- bool DrawImage(CDC * pDC, INT nXDest, INT nYDest, INT nDestWidth, INT nDestHeight, INT nXScr, INT nYSrc, INT nSrcWidth, INT nSrcHeight);
-
- public:
-
- bool AlphaDrawImage(CDC * pDestDC, INT xDest, INT yDest, BYTE cbAlphaDepth);
-
- bool AlphaDrawImage(CDC * pDestDC, INT xDest, INT yDest, INT cxDest, INT cyDest, INT xSrc, INT ySrc, BYTE cbAlphaDepth);
-
- bool AlphaDrawImage(CDC * pDestDC, INT xDest, INT yDest, INT cxDest, INT cyDest, INT xSrc, INT ySrc, INT cxSrc, INT cySrc, BYTE cbAlphaDepth);
-
- public:
-
- bool Draw( CDC * pDC, INT x, INT y, INT cx, INT cy,INT nLeft,INT nTop,INT nRight,INT nBottom );
-
- bool Draw( CDC * pDC, const RECT& rectDest, const RECT& rectSrc );
-
- bool Draw( CDC * pDC, const RECT& rectDest );
-
- public:
- bool DrawExtrude(CDC*pDC,const RECT& rectDest,bool bLeft=false,int nPixel=1);
- };
- #endif
|