Share a string between voids in C#
Does anybody knows a way to share a string between voids in C#.
This is the piece of code where I need the get my string:
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;
}
In here in need the get the 'capture' string:
Bitmap capture = new Bitmap(screenBounds.Width, screenBounds.Height);
And place 'capture' in this part:
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);
}
}
}
In here:
using (Graphics g = Graphics.FromImage(!!!Put Capture in Here!!!))
I hope someone can help
PS: If you don't understand the hole thing, I'm 14 and from the
netherlands, So i'm not the best English writer :-).
No comments:
Post a Comment