#if !defined(AFX_ShowPic22_H__636EAAC4_D01D_4170_93F6_9E363BB72892__INCLUDED_)
#define AFX_ShowPic22_H__636EAAC4_D01D_4170_93F6_9E363BB72892__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif 

#include "JPEG.h"
#include "MyAnimateWindow.h"
#include "PicBar.h"
#include "PreviewDlg.h"

class ChoosePhotoBase;

// �����ͼ;
class ShowPic22 : public CDialog
{
	// Construction
public:
	ShowPic22(CWnd* pParent = NULL);   // standard constructor
	enum { IDD = IDD_DLGShowPic2 };

	virtual BOOL PreTranslateMessage(MSG* pMsg);

public:
	void CutPhoto3();
	void CutPhoto2();
	void ShowInfo();
	void OnMouseWheel2(BOOL bZoomOut);
	void RunPicThread();
	void InitRc(Image *img, CRect &rc);
	
	void TerminateThread();
	void SetEffect(int effect);
	void Next();
	void Pre();
	void Rotate2();
	void Rotate1();
	void InitRc();
	void AutoPic();
	void LoadImage();

public:
	ChoosePhotoBase*		m_pParent;
	CStatic	m_sta1;

	// ��ǰ��ʾ����Ƭ·������;
	int m_nCurImgPos;
	// ԭͼƬ·�����飡��������������,�ʲ����������
	CStringArray*			m_pPathArrayBigsize;
	// ԭͼ·����mͼ·��������ѡƬʱ��;
	CStringArray* m_AryOfImgPath;				
	// ԭͼImageָ���ʹ�ÿ���ѡƬʱmͼImageָ�루m_AryOfImgPath�����е���Ƭ��;
	CArray<Image*, Image*> m_AryOfImgPtr;
	// ����ͼImageָ�룬������ͼ����ʾ���ȱ���ȫ������ʾ����m_AryOfImgPtr��Ӧ;
	CArray<Image*, Image*> m_AryOfSmallImgPtr;
	// m_AryOfImgPtrԪ����m_AryOfImgPath������λ��;
	CArray<int, int> m_nPosArray;

	bool				m_bRunning;		// Flag to whether thread is on running or not
	bool				m_bTerminate;	// Flag to Thread to be terminated
	unsigned int		m_dwThreadID;	// Thread ID
	HANDLE				m_hThread;		// Thread and Event handle
	BOOL				m_bauto;
	// �Ƿ���ʾ��Ƭ���Ƶ���Ϣ;
	BOOL				m_bShowImgInfo;
	BOOL				m_bInit;
	BOOL				m_bChooseBig;
	// ��ǰ��ʾ��ͼƬ;
	Image*		m_pCurShowImg;
	
private:
	// ��ǰ��ʾ������ͼ����m_pCurShowImg��Ӧ;
	Image*		m_pCurShowSmallImg;
	Image*		m_pImagetemp;

	BOOL		m_bcompared;
	CPoint		m_startpt;
	CPoint		m_startpt2;
	CPoint		m_startpt3;
	// ԭͼ������ͼ��Ҫ��ʾ������;
	CRect		m_rcImgShow;
	// ԭͼ������ͼ�Ŵ����Сǰ����ʾ����(�ڷŴ����Сǰ�ı���);
	CRect		m_rcImgShowBack;
	// ��Ļ�����С;
	CRect		m_rcScreen;
	// Picbar�ؼ���������;
	CRect		m_picbarrc;
	Bitmap*		m_pbmp;
	
	CBitmap		m_bmp;
	CDC			m_memdc;
	CPicture	m_pic;
	
	BOOL			m_bScroll;
	float			m_fscale;
	MyAnimateWindow m_dlg;		// �õƲ���ʱ�ij���Ч��;
	PicBar			m_PicBar;		// �ײ�������;
	PreviewDlg		m_PreviewDlg;	// �ұ���ʾ����ͼ;
	BOOL			m_bProcessing;
	BOOL			m_bShowEffect;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg void OnDestroy();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnClose();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg long ShowInfo2(WPARAM inWParam, LPARAM inLParam);

	DECLARE_MESSAGE_MAP()

};
#endif