有人知道在 C# 中的方法之间共享字符串的方法吗?
这是我需要获取字符串的代码:
private void timer1_Tick(object sender, EventArgs e)
{
// The screenshot will be stored in this bitmap.
Bitmap capture = new Bitmap(screenBounds.Width, screenBounds.Height);
// The code below takes the screenshot and
// saves it in "capture" bitmap.
g = Graphics.FromImage(capture);
g.CopyFromScreen(Point.Empty, Point.Empty, screenBounds);
// This code assigns the screenshot
// to the Picturebox so that we can view it
pictureBox1.Image = capture;
}
在这里需要获取“捕获”字符串:
Bitmap capture = new Bitmap(screenBounds.Width, screenBounds.Height);
并从此方法中“捕获”:
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
if (paint)
{
using (Graphics g = Graphics.FromImage(!!!Put Capture in Here!!!))
{
color = new SolidBrush(Color.Black);
g.FillEllipse(color, e.X, e.Y, 5, 5);
}
}
}
在这里:
using (Graphics g = Graphics.FromImage(!!!Put Capture in Here!!!))
我希望有人能帮帮忙!
PS:如果你不明白整件事,我今年 14 岁,来自荷兰,所以我不是最好的英语作家 :-)。