|
TColor __fastcall CImageDraw::SelColor(int x, int y, int Index)
{
TColor Color;
Color = clWhite;
int nX = MaxPoint.x;
int nY = MaxPoint.y;
TColor* MapColor; //TColor** Position;이렇게 표현은 못하나요?
TColor Position[100][100];
MapColor = new TColor[x*nX+y];
for(int i = 0; i< x+1; i++)
{
for(int j = 0; j< y+1; j++)
{
MapColor[i*nX+j] = Position[i][j];
Position[x][y] = clLime;
if(i%2==0)
Position[i][j] = clLime;
else
Position[i][j] = clRed;
if(j%2==0)
Position[i][j] = clLime;
else
Position[i][j] = clRed;
}
}
return Color;
}
: : : : : :
: : : : : : TColor __fastcall CImageDraw::SelColor(int x, int y)//x, y는 map이미지의 좌표를 생각했습니다.
: : : : : : {
: : : : : : TColor Color = clWhite;
: : : : : :
: : : : : : int rX = 1+x;
: : : : : : int rY = 1+y;
: : : : : :
: : : : : : TColor **Position;
: : : : : : Position = new TColor*[rX];
: : : : : : for(int j = 0; j < rX; j++)
: : : : : : {
: : : : : : Position[j] = new TColor[rY];
: : : : : : }
: : : : : :
: : : : : : for(int i = 0; i<rX; i++)
: : : : : : {
: : : : : : for(int j = 0; j< rY; j++)
: : : : : : {
: : : : : : if(i%2 == 0)
: : : : : : Position[i][j] = clRed;
: : : : : : else
: : : : : : Position[i][j] = clLime;
: : : : : : if(j%2 != 0)
: : : : : : Position[i][j] = clLime;
: : : : : : else
: : : : : : Position[i][j] = clRed;
: : : : : : Color = Position[i][j];
: : : : : : }
: : : : : : }
: : : : : :
: : : : : : return Color;
: : : : : : }
|