// MyPicSta.cpp : implementation file
//

#include "stdafx.h"
#include "LYFZIPManage.h"
#include "MyPicSta.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// MyPicSta

MyPicSta::MyPicSta()
{
	m_pImg=NULL;
}

MyPicSta::~MyPicSta()
{
}

BEGIN_MESSAGE_MAP(MyPicSta, CStatic)
	//{{AFX_MSG_MAP(MyPicSta)
	ON_WM_PAINT()
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// MyPicSta message handlers

void MyPicSta::SetImage(Image *img)
{
	m_pImg=img;
}

void MyPicSta::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	try
	{
	if(m_pImg==NULL)
		return;
	// TODO: Add your message handler code here
	CRect rc;
	GetClientRect(rc);

	Graphics graph(m_pbmp);
	graph.Clear(Color(255,0,0,0));

 	Rect desRect(0, 0, rc.Width (), rc.Height ()); 
	graph.DrawImage(m_pImg, desRect, 0,0,m_pImg->GetWidth(),m_pImg->GetHeight(),UnitPixel);

 
		Graphics graph2(dc.GetSafeHdc ());
		graph2.DrawImage(m_pbmp,0,0);


 	}
	catch(...)
	{
	}
 
	// Do not call CStatic::OnPaint() for painting messages
}

int MyPicSta::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CStatic::OnCreate(lpCreateStruct) == -1)
		return -1;
 
	// TODO: Add your specialized creation code here

	return 0;
}