53 lines
886 B
C++
53 lines
886 B
C++
#include "stdafx.h"
|
|
#include "io.h"
|
|
#include "PlayGifDlg.h"
|
|
|
|
IMPLEMENT_DYNAMIC(CPlayGifDlg, CDialog)
|
|
|
|
CPlayGifDlg::CPlayGifDlg(LPCTSTR pszGif, CWnd* pParent /*=nullptr*/)
|
|
: CDialog(IDD_DIALOG1, pParent)
|
|
, m_sGifPath(pszGif) { }
|
|
|
|
CPlayGifDlg::~CPlayGifDlg()
|
|
{
|
|
}
|
|
|
|
void CPlayGifDlg::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialog::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_PIC_GIF, m_picture);
|
|
}
|
|
|
|
BOOL CPlayGifDlg::OnInitDialog()
|
|
{
|
|
CDialog::OnInitDialog();
|
|
|
|
if (_taccess(m_sGifPath, 0x0) != 0x0) return TRUE;
|
|
|
|
if (!m_picture.Load(m_sGifPath)) return TRUE;
|
|
|
|
SIZE sz = m_picture.GetSize();
|
|
|
|
|
|
CenterWindow();
|
|
|
|
CRect winRct;
|
|
GetWindowRect(&winRct);
|
|
|
|
MoveWindow(winRct.left, winRct.top, sz.cx + 30, sz.cy + 50);
|
|
|
|
CenterWindow();
|
|
|
|
m_picture.Draw();
|
|
|
|
CRect paintRect;
|
|
m_picture.GetPaintRect(&paintRect);
|
|
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CPlayGifDlg, CDialog)
|
|
END_MESSAGE_MAP()
|