求那位高人指点一下,我编译没有错,filename也是取得到的
cxiamge demo 600这库无法打开超过200M以上的图片,求如何修改
最好是能够打开1G以上的图片就是显示不了图片,编译环境vs2008 sp1
BOOL CGetcolor::OnInitDialog()
{
CDialog::OnInitDialog();
CDC *pDC= CGetcolor::GetDlgItem(IDC_STATIC_PICTURE)->GetDC();
HDC hDC= pDC->GetSafeHdc();
GetDlgItem(IDC_STATIC_PICTURE)->GetClientRect(&rect);
//CdemoDoc* pDoc = (CdemoDoc*) ((CMainFrame*)AfxGetMainWnd())->GetActiveFrame()->GetActiveDocument();CdemoApp *app= (CdemoApp*)AfxGetApp();
AfxMessageBox(app->Cfilename);
DisplayImage(hDC,app->Cfilename);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}void CGetcolor:: DisplayImage(HDC hDC, CString filename)
{
CString fileExt; //图片的扩展名
CdemoDoc* pDoc = (CdemoDoc*) ((CMainFrame*)AfxGetMainWnd())->GetActiveFrame()->GetActiveDocument();
//CString filename(Cfilename);
CString ext(pDoc->FindExtension(filename));
ext.MakeLower();
int type = pDoc->FindType(ext);
if (ext == _T("")) {
AfxMessageBox(_T("没有输入带色卡的图片"));
}
else
{
//创建CxImage对象,其中静态方法CxImage::GetTypeIdFromName用来根据扩展名获得图片格式的ID代表
CxImage image1(filename,type);
if(image1.IsValid())
{
image1.Draw(hDC);
image1.Destroy();
}
}
}
cxiamge demo 600这库无法打开超过200M以上的图片,求如何修改
最好是能够打开1G以上的图片就是显示不了图片,编译环境vs2008 sp1
BOOL CGetcolor::OnInitDialog()
{
CDialog::OnInitDialog();
CDC *pDC= CGetcolor::GetDlgItem(IDC_STATIC_PICTURE)->GetDC();
HDC hDC= pDC->GetSafeHdc();
GetDlgItem(IDC_STATIC_PICTURE)->GetClientRect(&rect);
//CdemoDoc* pDoc = (CdemoDoc*) ((CMainFrame*)AfxGetMainWnd())->GetActiveFrame()->GetActiveDocument();CdemoApp *app= (CdemoApp*)AfxGetApp();
AfxMessageBox(app->Cfilename);
DisplayImage(hDC,app->Cfilename);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}void CGetcolor:: DisplayImage(HDC hDC, CString filename)
{
CString fileExt; //图片的扩展名
CdemoDoc* pDoc = (CdemoDoc*) ((CMainFrame*)AfxGetMainWnd())->GetActiveFrame()->GetActiveDocument();
//CString filename(Cfilename);
CString ext(pDoc->FindExtension(filename));
ext.MakeLower();
int type = pDoc->FindType(ext);
if (ext == _T("")) {
AfxMessageBox(_T("没有输入带色卡的图片"));
}
else
{
//创建CxImage对象,其中静态方法CxImage::GetTypeIdFromName用来根据扩展名获得图片格式的ID代表
CxImage image1(filename,type);
if(image1.IsValid())
{
image1.Draw(hDC);
image1.Destroy();
}
}
}
#define CXIMAGE_MAX_MEMORY 256000000 //原来声明的大小,自己改.
邮箱:[email protected]
void CTestView::OnOpen()
{
// TODO: Add your command handler code here CString strPicPath;
CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,_T("图片文件(*.jpg;*.jpeg;*.gif;,*.bmp)|*.jpg;*.jpeg;*.gif;*.bmp|位图文件(*.BMP)|*.BMP||"));
dlg.m_ofn.lpstrInitialDir=_T(".//");
if(IDOK==dlg.DoModal())
{strPicPath.Format(_T("%s"),dlg.GetPathName());}
CString fileExt;
int len=strPicPath.GetLength();
for(int i=len-1;i>=0;i--)
{if(strPicPath[i]=='.'){fileExt=strPicPath.Mid(i+1);break;}}
fileExt.MakeLower();
int type;
if(fileExt!=_T(""))
image.Load(strPicPath,type);
}
void CTestView::OnDraw(CDC* pDC)
{
CTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CRect rect;
GetClientRect(&rect);
image.Draw(pDC->GetSafeHdc(),rect);
}。。求解答。。
祝你好运了