问题一
Graphics g = e.Graphics;
Image texture1=Image.FromFile("G:\\c#project\\graph\\bin\\Debug\\Bottom_Middle.bmp");
TextureBrush brush = new TextureBrush(texture1);
g.FillRectangle(  brush, 100, 100, texture1.Width, texture1.Height);
为什么显示的图片“左边缺 右边多“呢(把多出来的“贴”到左边图片就 全了) 这是为什么呢 
我觉得他是先把图片先“贴“满整个窗体 然后把(100, 100, texture1.Width, texture1.Height)这个矩形区域显示出来 而我希望是在
(100, 100, texture1.Width, texture1.Height)划出这个图片
问题二
我在窗体上放了一个button1  当按了button1后 希望在Form1.text="xxx"   但为什么Form1没有text这个属性呢
我是刚学的  大家别笑我

解决方案 »

  1.   

    2. 
    this.Text = "xxx";
      

  2.   

    g.FillRectangle(  brush, 0, 0, texture1.Width, texture1.Height);Form1.Text
      

  3.   

    to all
    其实我的理解和大伙是一样的(既g.FillRectangle(  brush, 100, 100, texture1.Width, texture1.Height);在窗体坐标的100,100处确定一个矩形 大小是texture1.Width, texture1.Height   然后在这个矩形中进行填充)但是机器上就是显示不对  是否是因为我这个BMP比较小的原因或者是因为图片单位的问题呢(缇?pixel?)
    在button1_click 事件中  写Form1.Text 和  this.Text 其实是一样的吧  为什么Form1点后面没有Text这个属性呢
      

  4.   

    form1是你窗体的类的名字,你要设置Text属性只能对form1的对象的Text属性设置。
    这样说明白了么?
      

  5.   

    各位 brush哪个事情有谁能解决  刚才看见有位网友  在他的blog中提出了和我一样的感觉(先把图片先“贴“满整个窗体 然后把(100, 100, texture1.Width, texture1.Height)这个矩形区域显示出来)但他也没有提出解决方案
      

  6.   

    Graphics g = e.Graphics;
    Image TextImage = Image.FromFile("d:\\1.jpg");
    //Brush TextBrush = new TextureBrush(TextImage);

    Rectangle destRect = new Rectangle(100,100,TextImage.Width,TextImage.Height );
    g.DrawImage(TextImage,destRect);
      

  7.   


    我想把小图片放在窗体的右边   改成这样写 但是图片右边就是少一点  到底怎么能把这个小图片完整的 显示出来
    Graphics g = e.Graphics;
    Image TextImage = Image.FromFile("d:\\1.jpg");
    //Brush TextBrush = new TextureBrush(TextImage);

    Rectangle destRect = new Rectangle(this.Width-TextBrush.Width,0,TextImage.Width,TextImage.Height );
    g.DrawImage(TextImage,destRect);另外  当我把窗体最大化的时候  好像原来的图片还“残留”着  能否告诉怎么修改(我记得设置一下属性就可以了)