C# 想实现From1 中 点按钮 button1 后 根据 text_Box1 中的 内容(比如150) 对 picture_Box1 (大小是300,300)中的图象 进行 重新绘制 (Line(150,0,150,300)).
怎么实现?
高手能给出代码吗?----------------------------------------------------
0___(150,0)__(300,0)
|     |      |               testBox1-->[ 150 ]
|     |      |
|     |      |
|     |      |
|     |      |
|_____|______|(300,300)        button1  [ 重绘 ]
picture_Box1
_____________________________________________________

解决方案 »

  1.   

    Graphics g= this.picReload.CreateGraphics();
    Pen p= new Pen(Color.Black, 1);
    p1.X=Convert.ToInt32(txtGet.Text);
    p1.Y=0;
    p2.X=Convert.ToInt32(txtGet.Text);
    p2.Y=300;
    g.DrawLine(p,0,0,0,300);
    g.DrawLine(p,300,0,300,300);
    g.DrawLine(p,0,300,300,300);
             g.DrawLine(p,0,0,300,0);
    if(Convert.ToInt32(txtGet.Text)>0){g.DrawLine(p,p1.X,p1.Y,p2.X,p2.Y);}
    不太明白楼主的意思,写出来个简略的实现,希望能有帮助