コード例 #1
0
ファイル: Stone.cs プロジェクト: tian1ll1/WPF_Examples
		public void Draw( int x, int y, Board board)
		{
			Graphics g=board.Grap ;
			int w =board.Width/20;
			int x0,y0,r;
			x0= x*w-w/2;
			y0= y*w-w/2;
			r=w/2+w/2;
			
			Brush b = new SolidBrush(color);
			g.FillEllipse(b,x0,y0,r,r);
						
		}
コード例 #2
0
ファイル: Form1.cs プロジェクト: tian1ll1/WPF_Examples
		private void Form1_Load(object sender, System.EventArgs e)
		{
			if (this.panel1.Width>this.panel1.Height)
				this.panel1.Width=this.panel1.Height;
			else
				this.panel1.Height=this.panel1.Width;
			Graphics g = this.panel1.CreateGraphics();
			b = new Board(g);
			b.Width=this.panel1.Width ;
			b.Draw();
		}