아무도 C#에서 메서드간에 문자열을 공유하는 방법을 알고 있습니까? 필요에 여기에서 얻는 '캡처'문자열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!!!))
누군가 도와 드릴 수 있기를 바랍니다.
추신 : 모든 것을 이해하지 못한다면 저는 14 세이고 네덜란드 출신이기 때문에 나는 최고의 영어 작가가 아닙니다 .--).
'class' 내에 (메소드가 아닌)'private 비트 맵 캡쳐;를두고'this.capture' /'capture'를 사용하여 각 함수 내에서 참조하십시오. –
당신은 이미'paint'를 클래스 필드로 사용합니다. 'capture '와 동일하게 수행 –