#if !defined(AFX_PICTUREEX_H__AE8B5516_2D48_4556_B9A5_F66274FBC4D0__INCLUDED_)
#define AFX_PICTUREEX_H__AE8B5516_2D48_4556_B9A5_F66274FBC4D0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PictureEx.h : header file
//
// Load Picture Data Into The IPicture Interface (.BMP .DIB .EMF .GIF .ICO .JPG .WMF)
//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/////////////////////////////////////////////////////////////////////////////
// CPictureEx window

class CPictureEx : public CStatic
{
// Construction
public:
    CPictureEx();

// Attributes
public:

// Operations
    void FreePictureData();
    BOOL Load(CString sFilePathName, bool bSelfPaint = false, int nXOffset = 0, int nYOffset = 0);
    BOOL Load(UINT ResourceName, LPCSTR ResourceType, bool bSelfPaint = false, int nXOffset = 0, int nYOffset = 0);
    BOOL LoadPictureData(BYTE* pBuffer, int nSize);
    BOOL SaveAsBitmap(CString sFilePathName);
    BOOL Show(CDC* pDC, CPoint LeftTop, CPoint WidthHeight, int MagnifyX, int MagnifyY);
    BOOL Show(CDC* pDC, CRect DrawRect);
    BOOL ShowBitmapResource(CDC* pDC, const int BMPResource, CPoint LeftTop);
    BOOL UpdateSizeOnDC(CDC* pDC);

    IPicture* m_IPicture; // Same As LPPICTURE (typedef IPicture __RPC_FAR *LPPICTURE)

    LONG m_Height;        // Height (In Pixels Ignor What Current Device Context Uses)
    LONG m_Weight;        // Size Of The Image Object In Bytes (File OR Resource)
    LONG m_Width;         // Width (In Pixels Ignor What Current Device Context Uses)

public:
    CRect m_ClientRect;
    int   m_nOffsetx, m_nOffsety;
    int   m_nDisplayOffsetX, m_nDisplayOffsetY;
    CSize m_size;
    bool  m_bStretch;
    bool  m_bSelfPaint;
// Overrides
// ClassWizard generated virtual function overrides
// {{AFX_VIRTUAL(CPictureEx)
// }}AFX_VIRTUAL

// Implementation

public:
    void InitDrawTransparentMode(CString csFilename, CString csSectionName, CString csEnableKey, CString csColorKey);
    void SetTransparentColor(COLORREF color);
    void DisableDrawTransparentMode();
    void EnableDrawTransparentMode();
    void Show(CDC *pDC);
    void DisableStretch();
    void EnableStretch();
    virtual ~CPictureEx();

// Generated message map functions
protected:

// {{AFX_MSG(CPictureEx)
    afx_msg void OnPaint();
// }}AFX_MSG

    DECLARE_MESSAGE_MAP()

    CBitmap m_bmpMain;
    CBitmap m_bmpMask;

    bool     m_bEnableTransparentMode;
    COLORREF m_colorTransparent;
};

/////////////////////////////////////////////////////////////////////////////

// {{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PICTUREEX_H__AE8B5516_2D48_4556_B9A5_F66274FBC4D0__INCLUDED_)
