📄 w1.cpp
字号:
// W1.cpp : implementation file
//
#include "stdafx.h"
#include "MCS.h"
#include "W1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// W1
IMPLEMENT_DYNCREATE(W1, CMDIChildWnd)
W1::W1()
{
}
W1::~W1()
{
}
BOOL W1::Create(LPCTSTR szTitle, LONG style /* = 0 */,
const RECT& rect /* = rectDefault */,
CMDIFrameWnd* parent /* = NULL */)
{
LPCTSTR lpszBounceClass =
AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW,
LoadCursor(NULL, IDC_UPARROW),
(HBRUSH)(COLOR_WINDOW+1),
NULL);
return CMDIChildWnd::Create(lpszBounceClass, szTitle, style, rect, parent);
}
BEGIN_MESSAGE_MAP(W1, CMDIChildWnd)
//{{AFX_MSG_MAP(W1)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// W1 message handlers
void W1::OnPaint()
{
FILE *fp;
int boundary[200][200];
int i,j;
fp=fopen("MODEL.txt","r");
for(j=0;j<=100;j++)
{
for(i=0;i<=100;i++)
{
fscanf(fp,"%d",&boundary[i][j]);
}
fscanf(fp,"\n");
}
fclose(fp);
CPaintDC dc(this); // device context for painting
for(i=0;i<=100;i++)
{
for(j=0;j<=100;j++)
{
if(boundary[i][j]==0)
dc.SetPixel(i,j,RGB(255,255,0));
if(boundary[i][j]==1)
dc.SetPixel(i,j,RGB(0,255,255));
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -