⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 finalpaint.cpp

📁 数据挖掘中dbscan算法的vc实现的源代码
💻 CPP
字号:
// finalPaint.cpp : implementation file
//

#include "stdafx.h"
#include "dbscan from zealot.h"
#include "finalPaint.h"
#include "dbscan from zealotDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


extern basicNode graphTable[TOTAL];
extern int i;
extern int j;
extern long colorArray[20];

/////////////////////////////////////////////////////////////////////////////
// finalPaint dialog


finalPaint::finalPaint(CWnd* pParent /*=NULL*/)
	: CDialog(finalPaint::IDD, pParent)
{CClientDC paintDC1(this);

	/////////////////////////////
	for(i=0;i<=(TOTAL-1);i++)
   //paint(graphTable[i].x,graphTable[i].y,graphTable[i].id);
                    //???	
	////////////////////////////
	{//CClientDC paintDC(this);
		int tempx1=graphTable[i].x;
		int tempy1=graphTable[i].y;
		int id1=graphTable[i].id;

	int color;
	int level=id1%20;//构造一个颜色数组,通过level来取颜色数组的某一种颜色

color=colorArray[level];
paintDC1.SetPixel(tempx1+300,300-tempy1,color);//以(1000,300)为结果点阵的原点
paintDC1.SetPixel(tempx1+300+1,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1+1,color);
paintDC1.SetPixel(tempx1+300-1,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1-1,color);

if(graphTable[i].original==TRUE)//小十字
{paintDC1.SetPixel(tempx1+300+2,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1+2,color);
paintDC1.SetPixel(tempx1+300-2,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1-2,color);

}
else if(graphTable[i].original==2)//大十字
{paintDC1.SetPixel(tempx1+300+2,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1+2,color);
paintDC1.SetPixel(tempx1+300-2,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1-2,color);
paintDC1.SetPixel(tempx1+300+3,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1+3,color);
paintDC1.SetPixel(tempx1+300-3,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1-3,color);
paintDC1.SetPixel(tempx1+300+4,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1+4,color);
paintDC1.SetPixel(tempx1+300-4,300-tempy1,color);
paintDC1.SetPixel(tempx1+300,300-tempy1-4,color);
}
}
	//{{AFX_DATA_INIT(finalPaint)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void finalPaint::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(finalPaint)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(finalPaint, CDialog)
	//{{AFX_MSG_MAP(finalPaint)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// finalPaint message handlers

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -