A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© q55964133 中级黑马   /  2014-7-10 21:19  /  1059 人查看  /  4 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

本帖最后由 q55964133 于 2014-7-10 23:18 编辑
  1. private void btn_Strat_Click(object sender, EventArgs e)
  2.         {
  3.             Graphics g = Graphics.FromHwnd(this.GameMap.Handle);

  4.             int RowCount = 18;
  5.             int ColCount = 11;

  6.             int width = this.GameMap.Width / ColCount;

  7.             int Heigth = this.GameMap.Height / RowCount;

  8.             for (int rowindex = 0; rowindex < RowCount; rowindex++)
  9.             {
  10.                 for (int colindex = 0; colindex < ColCount;colindex++)
  11.                 {
  12.                     g.DrawRectangle(Pens.Black, new Rectangle(colindex * width, rowindex * Height, width, Heigth));
  13.                   
  14.                     
  15.                 }
  16.             }


  17.         }
复制代码


找不出什么问题。。。
看视频的老师这样可以生成全部 我只能生成1行。。。。不知道什么问题。。。
请大神指点。。。谢谢

评分

参与人数 1技术分 +1 收起 理由
czwanglei + 1

查看全部评分

4 个回复

倒序浏览
你的GameMap的高度会不会出问题了
回复 使用道具 举报
_xixi_ 发表于 2014-7-10 21:57
你的GameMap的高度会不会出问题了

没有。。。。
直接拉的。。。
就算出问题。。。最起码有生成几行。。。现在只生成1行

点评

把源代码打发给我~我也想琢磨俄罗斯方块~QQ:1964234340  发表于 2014-7-10 22:07
回复 使用道具 举报
没看懂 ,很深奥的样子啊1
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马