-
大小: 4.07MB文件類型: .rar金幣: 2下載: 0 次發布日期: 2023-10-28
- 語言: 其他
- 標簽:
資源簡介
1、畫直線:通過OnLine()函數實現。
2、畫矩形:通過OnRectangle()函數實現。
3、畫橢圓:通過OnEllipse()函數實現。
4、鉛筆工具:可以畫任意線條。通過OnPencil()函數實現。
5、右鍵彈出菜單:可以在客戶中點擊鼠標右鍵,快速選擇常用菜單。通過OnContextMenu函數實現。
6、狀態欄顯示鼠標移動的坐標:在程序的右下角顯示,通過OnUpdateX(CCmdUI *pCmdUI)和OnUpdateY(CCmdUI *pCmdUI)這兩個函數實現。
7、畫圖顏色選擇:可以畫任何顏色的線條,通過OnEditColor()函數實現。
8、讀取bmp位圖:可以在電腦中選擇一個bmp位圖,在程序中顯示出來,通過新建一個Cdib類來讀取bmp文件信息再view類和Doc類調用來顯示該位圖。
9、保存為bmp位圖:可以將在程序所畫的圖形保存為一幅bmp圖片,通過view中的SaveAsBmp(CString filename)實現。

代碼片段和文件信息
//?ChildFrm.cpp?:?implementation?of?the?CChildframe?class
//
#include?“stdafx.h“
#include?“Drawing.h“
#include?“ChildFrm.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CChildframe
IMPLEMENT_DYNCREATE(CChildframe?CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildframe?CMDIChildWnd)
//{{AFX_MSG_MAP(CChildframe)
ON_COMMAND(ID_EDIT_CUTOnEditCut)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code?!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CChildframe?construction/destruction
CChildframe::CChildframe()
{
//?TODO:?add?member?initialization?code?here
}
CChildframe::~CChildframe()
{
}
BOOL?CChildframe::PreCreateWindow(CREATESTRUCT&?cs)
{
//?TODO:?Modify?the?Window?class?or?styles?here?by?modifying
//??the?CREATESTRUCT?cs
// cs.cx=1024;
// cs.cy=768;
if(?!CMDIChildWnd::PreCreateWindow(cs)?)
return?FALSE;
cs.style???|=???WS_VISIBLE|WS_MAXIMIZE; //使子窗口一打開就是最大化
return?TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//?CChildframe?diagnostics
#ifdef?_DEBUG
void?CChildframe::AssertValid()?const
{
CMDIChildWnd::AssertValid();
}
void?CChildframe::Dump(CDumpContext&?dc)?const
{
CMDIChildWnd::Dump(dc);
}
void?CChildframe::OnEditCut()
{
}
#endif?//_DEBUG
/////////////////////////////////////////////////////////////////////////////
//?CChildframe?message?handlers
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1708??2010-10-26?14:47??Drawing\ChildFrm.cpp
?????文件???????1451??2010-10-10?00:30??Drawing\ChildFrm.h
?????文件??????16804??2010-10-26?14:47??Drawing\Debug\ChildFrm.obj
?????文件??????????0??2010-10-26?14:47??Drawing\Debug\ChildFrm.sbr
?????文件??????18146??2010-10-26?19:24??Drawing\Debug\Dib.obj
?????文件??????????0??2010-10-26?19:24??Drawing\Debug\Dib.sbr
?????文件????5555200??2010-10-27?09:40??Drawing\Debug\Drawing.bsc
?????文件?????147522??2010-10-27?09:40??Drawing\Debug\Drawing.exe
?????文件?????454240??2010-10-27?09:40??Drawing\Debug\Drawing.ilk
?????文件??????23790??2010-10-26?19:24??Drawing\Debug\Drawing.obj
?????文件????7038608??2010-10-24?17:37??Drawing\Debug\Drawing.pch
?????文件?????599040??2010-10-27?09:40??Drawing\Debug\Drawing.pdb
?????文件???????9440??2010-10-27?09:01??Drawing\Debug\Drawing.res
?????文件??????????0??2010-10-26?19:24??Drawing\Debug\Drawing.sbr
?????文件??????22883??2010-10-26?19:24??Drawing\Debug\DrawingDoc.obj
?????文件??????????0??2010-10-26?19:24??Drawing\Debug\DrawingDoc.sbr
?????文件??????60655??2010-10-27?09:40??Drawing\Debug\DrawingView.obj
?????文件??????????0??2010-10-27?09:40??Drawing\Debug\DrawingView.sbr
?????文件??????18945??2010-10-24?17:37??Drawing\Debug\MainFrm.obj
?????文件??????????0??2010-10-24?20:14??Drawing\Debug\MainFrm.sbr
?????文件??????15667??2010-10-26?09:58??Drawing\Debug\SettingDlg.obj
?????文件??????????0??2010-10-26?09:58??Drawing\Debug\SettingDlg.sbr
?????文件?????105530??2010-10-24?17:37??Drawing\Debug\StdAfx.obj
?????文件????1374944??2010-10-24?17:37??Drawing\Debug\StdAfx.sbr
?????文件?????246784??2011-07-09?10:08??Drawing\Debug\vc60.idb
?????文件?????380928??2010-10-27?09:40??Drawing\Debug\vc60.pdb
?????文件???????6714??2010-10-26?19:24??Drawing\Dib.cpp
?????文件???????2095??2010-10-26?19:24??Drawing\Dib.h
?????文件??????32664??2010-10-27?09:28??Drawing\Drawing.aps
?????文件???????4080??2010-10-27?09:50??Drawing\Drawing.clw
............此處省略32個文件信息
- 上一篇:logix5000 通用破解
- 下一篇:計算圖像均值方差
評論
共有 條評論