如何获得在C#中的图片框绘制图形

问题描述:

我已经创建了一个小组一个PictureBox。我画上的PictureBox一些图形。
我想获得点击按钮的图形。我该怎么做?

I have created a PictureBox in a panel. I drew some graphics on PictureBox. I want to get those graphics on button clicking. How can I do that?

我想你想要的是您有一定的图形绘制在一个图片,你希望这些图形在Button 的点击一个形象,是不是它。我我不知道这是否会工作,但尝试;

I think what you want is You have some graphics drawn over a PictureBox and you want a Image of those graphics on the click of a Button,isn't it.I am not sure if this'll work but try it;

    private void ButtonGetImage_Click(object sender, EventArgs e)
    {
      if (SourcePictureBox.Image != null)//Just to make sure it's not empty.
       {
         Bitmap graphic = new Bitmap(SourcePictureBox.Image);
          {
            //Add some logic to modify Image if you want.
            graphic.Save(@"F:\Image.bmp");//An appropriate path to save the file.
            graphic.Dispose();
          }
       }
    }