40楼#
发布于:2003-10-27 16:52
f (ext == \"\") return FALSE;
int type = FindType(ext); if (type == CXIMAGE_FORMAT_UNKNOWN) return FALSE; bool retval; Stopwatch(0); retval = image->Save(filename, type); Stopwatch(1); UpdateStatusBar(); if (retval) return TRUE; AfxMessageBox(image->GetLastError()); return FALSE; } ////////////////////////////////////////////////////////////////////////////// BOOL CDemoDoc::DoSave(LPCTSTR pszPathName, |
|
41楼#
发布于:2003-10-27 16:52
if (!image) return FALSE; CString newName = pszPathName; BOOL bModified = IsModified(); BOOL bSaveAs = FALSE; if (newName.IsEmpty()) bSaveAs = TRUE; else if (!theApp.GetWritableType(image->GetType())) bSaveAs = TRUE; if (bSaveAs){ newName = m_strPathName; |
|
42楼#
发布于:2003-10-27 16:53
if (bReplace && newName.IsEmpty()){
newName = m_strTitle; int iBad = newName.FindOneOf(_T(\"#%;/\\\\\")); // dubious filename if (iBad != -1) //newName.ReleaseBuffer(iBad); newName = \"UntitledImage\"; // append the default suffix if there is one if (image->GetType()) newName += theApp.GetExtFromType(image->GetType()).Mid(1,4); } int nDocType = image->GetType(); if (!theApp.PromptForFileName(newName, bReplace ? AFX_IDS_SAVEFILE : AFX_IDS_SAVEFILECOPY, OFN_HIDEREADONLY | OFN_PATHMUSTEXIST, FALSE, &nDocType)) { return FALSE; // don\'t even try to save } } BeginWaitCursor(); if (!OnSaveDocument(newName)){ |
|
43楼#
发布于:2003-10-27 16:53
// be sure to delete the file
TRY { CFile::Remove(newName); } CATCH_ALL(e) { TRACE0(\"Warning: failed to delete file after failed SaveAs\\n\"); } |
|
44楼#
发布于:2003-10-27 16:54
END_CATCH_ALL
} EndWaitCursor(); return FALSE; } EndWaitCursor(); if (bReplace) { // Reset the title and change |
|
45楼#
发布于:2003-10-27 16:55
SetPathName(newName, TRUE);
ASSERT(m_strPathName == newName); // must be set } else // SaveCopyAs { SetModifiedFlag(bModified); } return TRUE; // success } ////////////////////////////////////////////////////////////////////////////// #define EPSILON (0.0000001) |
|
46楼#
发布于:2003-10-27 17:07
moDoc::ComputePixel(float x, float y, float &x1, float &y1)
{ double r, nn; if (x==0 && y==0) { x1 = x; y1 = y; return 1; } nn = sqrt(x*x + y*y); r = (fabs(x) > fabs(y)) ? fabs(nn/x): fabs(nn/y); |
|
47楼#
发布于:2003-10-27 17:12
id CDemoDoc::OnUpdateFileSaveAs(CCmdUI* pCmdUI)
{ pCmdUI->Enable(!(image==0 || hThread)); } ////////////////////////////////////////////////////////////////////////////// void CDemoDoc::OnUpdateFileSave(CCmdUI* pCmdUI) { pCmdUI->Enable(0); // pCmdUI->Enable((image != NULL)); //&& theApp.GetWritableType(image->GetType())); } ////////////////////////////////////////////////////////////////////////////// void CDemoDoc::OnStretchMode() { stretchMode = !stretchMode; UpdateAllViews(NULL); } ////////////////////////////////////////////////////////////////////////////// void CDemoDoc::OnUpdateStretchMode(CCmdUI* pCmdUI) { |
|
48楼#
发布于:2003-10-27 17:14
id CDemoDoc::OnUpdateFileSaveAs(CCmdUI* pCmdUI) |
|
49楼#
发布于:2003-10-27 17:16
记得多给我分啊!hai wo |
|
50楼#
发布于:2003-10-27 17:16
感觉驱网的水友网友关系也很亲近啊!希望早日回来! :D :D :D9494 |
|
51楼#
发布于:2003-10-27 17:17
怎么还没有人来啊!? :D我来了 |
|
52楼#
发布于:2003-10-27 17:17
grant兄换个标题吧,看来不吸引人啊! :D同意 |
|
53楼#
发布于:2003-10-27 17:18
有这么多分,看来今天的帖子数量又要涨许多了!^_^肯定阿 |
|
54楼#
发布于:2003-10-27 17:19
[quote]怎么还没有人来啊!? :D 刚才没看到,现在看到了。 [/quote]我也是 |
|
55楼#
发布于:2003-10-27 17:19
什么时候放分啊? :D :D是啊 |
|
56楼#
发布于:2003-10-27 17:19
哇靠,转眼就到第二页了第三页了 |
|
57楼#
发布于:2003-10-27 17:20
[quote]我只是告别而已, 我的意思是,大家不来你怎么放分啊?不能只给我一人吧!?(其实这正是我希望的,贪婪的说) :D :D :D [/quote]太贪了?! |
|
58楼#
发布于:2003-10-27 17:20
那你启不和我们一样了?! :D :D :D怎么? |
|
59楼#
发布于:2003-10-27 17:20
看我这么执着,不如就都给我算了,反正现在只有你我二人! :D :DNO |
|