#include "stdafx.h"
#include "qux.h"
#include "zhu.h"
#include "atlimage.h"
// Czhu 对话框
IMPLEMENT_DYNAMIC(Czhu, CDialog)
Czhu::Czhu(CWnd* pParent /*=NULL*/)
: CDialog(Czhu::IDD, pParent)
{
}
Czhu::~Czhu()
{
}
void Czhu::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(Czhu, CDialog)
ON_BN_CLICKED(IDC_BUTTON1, &Czhu::OnBnClickedButton1)
END_MESSAGE_MAP()
// Czhu 消息处理程序
void Czhu::OnBnClickedButton1()
{
// TODO: 在此添加控件通知处理程序代码
CFileDialog fileDlg(TRUE, _T("png"), NULL, 0, _T("all Files(*.*)|*.*||"), this);
if(IDOK == fileDlg.DoModal())
{
fileDlg.DoModal();
CString strFilePath;
strFilePath = fileDlg.GetPathName();
if (strFilePath == _T(""))
{
return;
}
CRect rc;
GetDlgItem(IDC_STATIC1)->GetClientRect(rc);
CImage image;
image.Load(strFilePath); //图片文件路径
if (image.GetBPP() == 32)
{
int i; int j;
for (i = 0; i < image.GetWidth(); i++)
{
for (j = 0; j < image.GetHeight(); j++)
{
byte pByte = (byte *)image.GetPixelAddress(i, j);
pByte[0] = pByte[0] * pByte[3] / 255;
pByte[1] = pByte[1] * pByte[3] / 255;
pByte[2] = pByte[2] * pByte[3] / 255;
}
}
}
CDC dc;
dc = GetDlgItem(IDC_STATIC1)->GetDC();
image.Draw(dc->m_hDC, rc);
ReleaseDC(dc);
}
}
然后就报错
1>qux.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall CquxDlg::CquxDlg(class CWnd *)" (??0CquxDlg@@QAE@PAVCWnd@@@Z),该符号在函数 "public: virtual int __thiscall CquxApp::InitInstance(void)" (?InitInstance@CquxApp@@UAEHXZ) 中被引用 1>D:\My Documents\Visual Studio 2008\Projects\qux\Debug\qux.exe : fatal error LNK1120: 1 个无法解析的外部命令
这怎么改