//
LRESULT CMy567View::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: 在此添加专用代码和/或调用基类
if (WM_COMMAND == message)
{
WORD wd = LOWORD(wParam);
if (wd == 123)
{
// CDC* pDC = GetDC();
// CString str;
// str = "文字";
// pDC->TextOut(100, 100, str);
// ReleaseDC(pDC);
openImage();
if (loadJPGFile())
{
CDC* pDC = GetDC();
drawImage( 100, 100, pDC);
ReleaseDC(pDC);
}
}
}
return CView::DefWindowProc(message, wParam, lParam);
}
void CMy567View::openImage()
{
CFileDialog dlg(
TRUE,
_T("jpg|jpeg|gif"),
NULL,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
_T("JPG Files (*.jpg)|*.jpg|JPEG Files (*.jpeg)|*.jpeg|GIF Files (*.gif)|*.gif|All Files (*.*)|*.*||"));
if (dlg.DoModal() == IDOK)
{
m_sImagePath = dlg.GetPathName();
MessageBox(m_sImagePath);
}
}
BOOL CMy567View::loadJPGFi