void MM_DRAW()
{
int xx=0, yy=0, width=0, height=0;
for(int ii=0; ii<MAPY-1; ii++)
{
for(int kk=1; kk<MAPX-1; kk++)
{
xx = (kk-1) * ( this.Width/ (MAPX-2) );
yy = (ii) * ( (this.ClientRectangle.Height)/ (MAPY-1) );
width = (this.Width /(MAPX-2));
height=((this.ClientRectangle.Height/(MAPY-1));
if(toggle_for_draw==0)
{
if(hexa[ii,kk] > 0) MM_FORE_DRAW(xx,yy,width,height,DEFINENM.colorindex[ hexa[ii,kk] ]);
else MM_BACK_DRAW(xx,yy,width,height);
}
else
{
if(hexa_copy_for_draw[ii,kk] != hexa[ii,kk])
{
if(hexa[ii,kk]>0) MM_FORE_DRAW(xx,yy,width,height,DEFINENM.colorindex[ hexa[ii,kk] ]);
else MM_BACK_DRAW(xx,yy,width,height);
}
}
}
}
}
void MM_FORE_DRAW(int xx, int yy, int width, int height, System.Drawing.Color ____color)
{
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(____color);
System.Drawing.Pen myPen = new System.Drawing.Pen( System.Drawing.Color.LightGray, 1);
System.Drawing.Graphics myGraphic;
myGraphic=this.CreateGraphics();
myGraphic.FillRectangle(myBrush, new Rectangle(xx,yy,width,height));
myGraphic.DrawRectangle(myPen,xx,yy,width,height);
}
void MM_BACK_DRAW(int xx, int yy, int width, int height)
{
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush( System.Drawing.Color.LightYelow);
System.Drawing.Pen myPen = new System.Drawing.Pen( System.Drawing.Color.LightGray, 1);
System.Drawing.Graphics myGraphic;
myGraphic=this.CreateGraphics();
myGraphic.FillRectangle(myBrush, new Rectangle(xx,yy,width,height));
myGraphic.DrawRectangle(myPen,xx,yy,width,height);
}
'헥사' 카테고리의 다른 글
Systehttp://m.Drawing.Color[] colorindex = new Systehttp://m.Drawing.Color[] (0) | 2023.11.29 |
---|---|
헥사 개발코드관련 (0) | 2021.04.27 |