2
我在面板中創建了一個PictureBox。我在PictureBox上繪製了一些圖形。 我想要點擊按鈕上的圖形。我怎樣才能做到這一點?如何在c中的圖片框上繪製圖形#
我在面板中創建了一個PictureBox。我在PictureBox上繪製了一些圖形。 我想要點擊按鈕上的圖形。我怎樣才能做到這一點?如何在c中的圖片框上繪製圖形#
我認爲你想要的是你有一些圖片繪製在一個PictureBox上,你想要一個圖像的點擊一個按鈕這些圖形,是不是。我不知道這是否會工作,但嘗試一下;
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();
}
}
}
的可能的複製[如何調用從按鈕單擊事件油漆事件?(http://stackoverflow.com/questions/27766600/how-to-call-paint-event-from-a-button -Click事件) – 2016-09-27 18:48:12