資源簡介
包含文件說明:
1. SolveFlashingAndRedrawv1.0.5 純凈版
無閃爍的MFC應(yīng)用框架,實(shí)際使用時把此工程改名成你要建立的項(xiàng)目名稱,然后開始開發(fā)即可。你熟悉MFC的話研究這個框架的半個小時應(yīng)該就明白并熟練運(yùn)用了。
2.SolveFlashingAndRedrawv1.0.5 demo版
利用SolveFlashingAndRedrawv1.0.4框架寫的一個示例小程序,主要展示框架要實(shí)現(xiàn)的優(yōu)點(diǎn)特性。
3.VCRn 修改vc工程名工具 ___作者 田彬.exe
用網(wǎng)上找到的一個MFC改工程名稱的小工具,很實(shí)用。如果你想使用本框架就可以用它來改成你想要的工程名了。
4. 未使用本框架的類似功能簡化程序
沒有使用框架的程序,實(shí)現(xiàn)的功能和Demo類似。但是運(yùn)行之后改變窗口大小等,會發(fā)現(xiàn)圖形閃爍很厲害!
5. SolveFlashingAndRedrawv1.0.5 demo版 運(yùn)行截圖.jpg
6. ReadMe.txt
說明文件。
補(bǔ)充說明:
工程使用vc6.0開發(fā),如果你用vc6.0雙擊.dsw文件無法打開,請先打開vc6.0然后把.dsw拖動到vc上面。 如果這種方法還是無法打開,你新建一個vc6.0 mfc sdi程序,把示例中框架拷貝到這個新工程中,運(yùn)行即可,代碼量不是太多。
框架說明:
/******************************************************
SolveFlashingAndRedraw框架說明
******************************************************/
/**
項(xiàng)目名稱:
demo框架
版本號: v1.0.5
第一作者: Jef
地址: 中國/江蘇
日期: 20100724
電子郵箱: dungeonsnd@126.com
版權(quán):
1.您可以修改及免費(fèi)使用本程序。
2.修改之后附上您的個人信息發(fā)送到上面的作者郵箱,作者負(fù)責(zé)在全面測試后發(fā)布您修改后的新版本。
3.您使用本程序而導(dǎo)致任何傷害以及經(jīng)濟(jì)損失,由過錯方依法承擔(dān)所有責(zé)任,一概與第一作者及合作單位無關(guān)。
4.如果您使用本程序則表示您已經(jīng)同意此版本協(xié)議!否則請勿使用!
項(xiàng)目功能:
SolveFlashingAndRedraw框架是MFC解決窗口保存及重繪閃爍問題的一種比較好的方案(Win32解決方法類似)。
版本歷史:
v1.0.1 20091126 第一版本
v1.0.2 20091212 第二版本
1. 修改了部分變量的名字使其更符合其意義
2. 增加為兩個工程,一是帶demo例子的,另一是不帶demo的純凈版.
3. 修改了其中一個錯誤. 如 CreateCompatibleDC之后沒有調(diào)用DeleteDC等.
v1.0.3 對v1.0.2進(jìn)行了整理
v1.0.4 20100416 在v1.0.3的基礎(chǔ)上進(jìn)行整理,并增加了裁剪區(qū),提高了繪圖效率!
v1.0.5 20100724
1. 添加了一個工具類CMemBmpDc,幫助產(chǎn)生一個內(nèi)存DC,并把指定的內(nèi)存位圖選進(jìn)去。方便繪圖。
2. 演示了在適當(dāng)時機(jī)如何高效畫圖,見Demo版的DrawSinwave(bool bDrawOnScreen)函數(shù)。
演示了用兩種方法來繪圖,
方法1. 直接繪圖到屏幕上,
同時繪圖到內(nèi)存位圖上,內(nèi)存位圖不會立即貼到屏幕上減少了內(nèi)存拷貝的時間,提高了效率,
將來窗口失效時OnPait貼圖到屏幕上.
這種方法的優(yōu)點(diǎn)時減小了不必要的內(nèi)存拷貝,缺點(diǎn)時當(dāng)繪圖內(nèi)存復(fù)雜并且非常耗時可能會導(dǎo)致閃爍。
故適用于像本Demo的這樣繪圖(本例函數(shù)只繪制一小段直線)。
方法2. 繪制到內(nèi)存位圖上后把應(yīng)該重繪的這一小塊設(shè)成裁剪區(qū),然后立即OnPait重繪這個裁剪區(qū)。
運(yùn)行步驟:
直接運(yùn)行demo里面的程序,在窗口上任意拖拉鼠標(biāo)畫線,然后點(diǎn)擊菜單欄的幾個示范菜單項(xiàng),然后移動窗口、
改變窗口大小、最大最小化窗口、用其它窗口覆蓋此窗口、鼠標(biāo)放到任務(wù)欄。。。
以上種種操作觀察窗口內(nèi)的圖像變化。可以發(fā)現(xiàn)窗口內(nèi)圖像幾乎看不到閃爍,而且窗口的元素已經(jīng)保存下來重繪時任然可以看到圖像。
如何使用:
進(jìn)行項(xiàng)目開發(fā)時,可以先建立項(xiàng)目,然后把本解決方案框架拷貝到新建項(xiàng)目中即可。 也可以自己根據(jù)需要修改純凈版。
其它:
友情提示,小心 View類頭文件及View類的實(shí)現(xiàn)文件中有說明,使用時別把它弄到你實(shí)際項(xiàng)目里哦!
進(jìn)行大量復(fù)雜的圖形的輸出,而且對效率要求特別高

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“SolveFlashingAndRedraw.h“
#include?“MainFrm.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CMainframe
IMPLEMENT_DYNCREATE(CMainframe?CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe?CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code?!
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static?UINT?indicators[]?=
{
ID_SEPARATOR???????????//?status?line?indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?construction/destruction
CMainframe::CMainframe()
{
//?TODO:?add?member?initialization?code?here
}
CMainframe::~CMainframe()
{
}
int?CMainframe::OnCreate(LPCREATESTRUCT?lpCreateStruct)
{
if?(CframeWnd::OnCreate(lpCreateStruct)?==?-1)
return?-1;
if?(!m_wndToolBar.CreateEx(this?TBstyle_FLAT?WS_CHILD?|?WS_VISIBLE?|?CBRS_TOP
|?CBRS_GRIPPER?|?CBRS_TOOLTIPS?|?CBRS_FLYBY?|?CBRS_SIZE_DYNAMIC)?||
!m_wndToolBar.LoadToolBar(IDR_MAINframe))
{
TRACE0(“Failed?to?create?toolbar\n“);
return?-1;??????//?fail?to?create
}
if?(!m_wndStatusBar.Create(this)?||
!m_wndStatusBar.SetIndicators(indicators
??sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed?to?create?status?bar\n“);
return?-1;??????//?fail?to?create
}
//?TODO:?Delete?these?three?lines?if?you?don‘t?want?the?toolbar?to
//??be?dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return?0;
}
BOOL?CMainframe::PreCreateWindow(CREATESTRUCT&?cs)
{
if(?!CframeWnd::PreCreateWindow(cs)?)
return?FALSE;
//?TODO:?Modify?the?Window?class?or?styles?here?by?modifying
//??the?CREATESTRUCT?cs
return?TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?diagnostics
#ifdef?_DEBUG
void?CMainframe::AssertValid()?const
{
CframeWnd::AssertValid();
}
void?CMainframe::Dump(CDumpContext&?dc)?const
{
CframeWnd::Dump(dc);
}
#endif?//_DEBUG
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?message?handlers
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????8616??2010-07-24?11:48??SolveFlashingAndRedraw框架?v1.0.5\ReadMe.txt
?????文件???????2523??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\MainFrm.cpp
?????文件???????1581??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\MainFrm.h
?????文件???????1300??2010-07-24?10:27??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\MemBmpDc.cpp
?????文件????????505??2010-07-24?10:27??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\MemBmpDc.h
?????文件???????4695??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\ReadMe.txt
?????文件???????1078??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\res\SolveFlashingAndRedraw.ico
?????文件????????414??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\res\SolveFlashingAndRedraw.rc2
?????文件???????1078??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\res\SolveFlashingAndRedrawDoc.ico
?????文件???????1078??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\res\Toolbar.bmp
?????文件????????750??2010-04-16?22:58??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\resource.h
?????文件??????30020??2010-07-24?11:13??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.aps
?????文件???????2639??2010-07-24?11:45??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.clw
?????文件???????4497??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.cpp
?????文件???????5020??2010-07-24?11:39??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.dsp
?????文件????????569??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.dsw
?????文件??????40960??2010-07-24?11:45??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.exe
?????文件???????1532??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.h
?????文件?????107520??2010-07-24?11:45??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.ncb
?????文件??????53760??2010-07-24?11:45??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.opt
?????文件???????2010??2010-07-24?11:45??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.plg
?????文件??????12146??2010-04-16?22:58??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedraw.rc
?????文件???????2062??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedrawDoc.cpp
?????文件???????1651??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedrawDoc.h
?????文件??????19444??2010-07-24?11:40??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedrawView.cpp
?????文件??????11284??2010-07-24?11:45??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\SolveFlashingAndRedrawView.h
?????文件????????224??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\StdAfx.cpp
?????文件???????1054??2009-12-12?20:47??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版\StdAfx.h
?????文件?????153262??2010-04-16?23:48??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版?運(yùn)行截圖.jpg
?????文件????8813568??2010-04-16?23:32??SolveFlashingAndRedraw框架?v1.0.5\SolveFlashingAndRedrawv1.0.5?demo版?運(yùn)行視頻.avi
............此處省略62個文件信息
評論
共有 條評論