}
CRussia::~CRussia()
{
}
void CRussia::DrawMain(CDC *pDC)
{
HBRUSH hBkBru,hForBru,hNextBru,hStiBru;
HPEN hPen,hPen2;
switch(ColNow.nCol)
{
case 0:
hForBru = CreateSolidBrush(RGB(255,0,0));break;
case 1:
hForBru = CreateSolidBrush(RGB(0,255,0));break;
case 2:
hForBru = CreateSolidBrush(RGB(0,0,255));break;
case 3:
hForBru = CreateSolidBrush(RGB(255,255,0));break;
case 4:
hForBru = CreateSolidBrush(RGB(255,0,255));break;
case 5:
hForBru = CreateSolidBrush(RGB(0,255,255));break;
case 6:
hForBru = CreateSolidBrush(RGB(200,50,100));break;
}
本文来自辣.文~论^文·网原文请找腾讯32491.14
hBkBru = CreateSolidBrush(RGB(0,0,0));
hNextBru = CreateSolidBrush(RGB(255,0,0));
hPen = CreatePen(PS_SOLID,2,RGB(0,0,0));
hPen2 = CreatePen(PS_SOLID,1,RGB(95,90,90));
int i,j;
for (i = 0;i < 10;i++)
for(j = 0;j < 20;j++)
{
if (ColBox[i][j].nFlag == 1)
{
pDC->SelectObject(hPen2);
pDC->SelectObject(hForBru);
pDC->Rectangle(i*20,j*20,(i+1)*20,(j+1)*20);
}
else if (ColBox[i][j].nFlag == 2)
{
switch(ColBox[i][j].nCol)
{
case 0:
hStiBru = CreateSolidBrush(RGB(255,0,0));break;
case 1:
hStiBru = CreateSolidBrush(RGB(0,255,0));break;
case 2:
hStiBru = CreateSolidBrush(RGB(0,0,255));break;
case 3:
hStiBru = CreateSolidBrush(RGB(255,255,0));break;
case 4:
hStiBru = CreateSolidBrush(RGB(255,0,255));break;
case 5:
hStiBru = CreateSolidBrush(RGB(0,255,255));break;
case 6:
hStiBru = CreateSolidBrush(RGB(200,50,100));break;
}
pDC->SelectObject(hPen2);
pDC->SelectObject(hStiBru);
pDC->Rectangle(i*20,j*20,(i+1)*20,(j+1)*20);
DeleteObject(hStiBru);