• 大小: 141KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: C/C++
  • 标签: mfc/c++  

资源简介

用vs,用已有代码生成工程既可用。这是我大二的c++大作业,支持画矩形,直线,圆,和铅笔。矩形可以移动,变大变小,屏幕刷新后,图像可保存。无文件操作

资源截图

代码片段和文件信息


// MainFrm.cpp : CMainframe 类的实现
//

#include “stdafx.h“
#include “MFCApplication5.h“

#include “MainFrm.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CMainframe

IMPLEMENT_DYNCREATE(CMainframe CframeWnd)

BEGIN_MESSAGE_MAP(CMainframe CframeWnd)
ON_WM_CREATE()
END_MESSAGE_MAP()

static UINT indicators[] =
{
ID_SEPARATOR           // 状态行指示器
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};

// CMainframe 构造/析构

CMainframe::CMainframe()
{
// TODO: 在此添加成员初始化代码
}

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(“未能创建工具栏\n“);
return -1;      // 未能创建
}

if (!m_wndStatusBar.Create(this))
{
TRACE0(“未能创建状态栏\n“);
return -1;      // 未能创建
}
m_wndStatusBar.SetIndicators(indicators sizeof(indicators)/sizeof(UINT));

// TODO: 如果不需要可停靠工具栏,则删除这三行
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: 在此处通过修改
//  CREATESTRUCT cs 来修改窗口类或样式

return TRUE;
}

// CMainframe 诊断

#ifdef _DEBUG
void CMainframe::AssertValid() const
{
CframeWnd::AssertValid();
}

void CMainframe::Dump(CDumpContext& dc) const
{
CframeWnd::Dump(dc);
}
#endif //_DEBUG


// CMainframe 消息处理程序


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1782  2017-05-09 18:51  bigwork\MFCApplication5\MainFrm.cpp

     文件        669  2017-05-09 18:51  bigwork\MFCApplication5\MainFrm.h

     文件     121768  2017-05-12 08:32  bigwork\MFCApplication5\MFCApplication5.aps

     文件       4409  2017-05-09 21:13  bigwork\MFCApplication5\MFCApplication5.cpp

     文件        563  2017-05-09 18:51  bigwork\MFCApplication5\MFCApplication5.h

     文件      12399  2017-05-12 08:32  bigwork\MFCApplication5\MFCApplication5.rc

     文件      10740  2017-05-09 18:51  bigwork\MFCApplication5\MFCApplication5.vcxproj

     文件       2686  2017-05-09 18:51  bigwork\MFCApplication5\MFCApplication5.vcxproj.filters

     文件        238  2017-05-09 19:26  bigwork\MFCApplication5\MFCApplication5.vcxproj.user

     文件       2709  2017-05-09 18:51  bigwork\MFCApplication5\MFCApplication5Doc.cpp

     文件        901  2017-05-09 18:51  bigwork\MFCApplication5\MFCApplication5Doc.h

     文件      11986  2017-05-12 08:47  bigwork\MFCApplication5\MFCApplication5View.cpp

     文件       2319  2017-05-12 08:32  bigwork\MFCApplication5\MFCApplication5View.h

     文件       4945  2017-05-09 18:51  bigwork\MFCApplication5\ReadMe.txt

     文件      67777  2017-05-08 09:46  bigwork\MFCApplication5\res\MFCApplication5.ico

     文件        686  2017-05-09 18:51  bigwork\MFCApplication5\res\MFCApplication5.rc2

     文件       4710  2017-05-08 09:46  bigwork\MFCApplication5\res\MFCApplication5Doc.ico

     文件       1078  2017-05-08 09:46  bigwork\MFCApplication5\res\Toolbar.bmp

     文件       1197  2017-05-12 08:32  bigwork\MFCApplication5\resource.h

     文件        148  2017-05-09 18:51  bigwork\MFCApplication5\stdafx.cpp

     文件       1578  2017-05-09 18:51  bigwork\MFCApplication5\stdafx.h

     文件        240  2017-05-09 18:51  bigwork\MFCApplication5\targetver.h

     文件       1327  2017-05-09 18:51  bigwork\MFCApplication5.sln

     目录          0  2017-05-12 16:20  bigwork\MFCApplication5\res

     目录          0  2017-05-12 16:20  bigwork\MFCApplication5

     目录          0  2017-05-12 16:20  bigwork

----------- ---------  ---------- -----  ----

               256855                    26


评论

共有 条评论

相关资源