2013-09-24 1 views
1

나는 고급 스크린 샷을 찍기 위해 프로그램 작업을하고 있습니다. 하지만 나는 버그가 붙어있어 누군가가 나를 도울 수 있기를 바랍니다.Picturebox에 이미지가있는 그림 그리기 및 저장

  • 이 코드와 함께 스크린 샷을 만들 수 있습니다

     // 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; 
        pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; 
    
        // The code below make the form visible again, enables the "Save" button and stops the timer. 
        this.Show(); 
        button2.Enabled = true; 
        timer1.Stop(); 
    
  • 가있는 PictureBox에 그리기 :

     color = new SolidBrush(Color.Black); 
         Graphics g = pictureBox1.CreateGraphics(); 
         g.FillEllipse(color, e.X, e.Y, 10, 10); 
         g.Dispose(); 
    

이 문제 : 난 단지 스크린 샷을 저장할 수 있습니다, 도면이 아닙니다. 당신이 구멍의 일을 이해하지 않으면 내가 (14)와 네덜란드에서 왔어요, 그래서 나는 최고의 영어 작가가 아니에요 :
나는 누군가가

PS를 도울 수 있기를 바랍니다.

+1

'드로잉'을 저장하는 코드는 어디에 있습니까? –

답변

0

CreateGraphics() - 임시 그림입니다. 캡처 이미지 사용 :

using (Graphics g = Graphics.FromImage(capture)) { 
    g.FillEllipse(color, e.X, e.Y, 10, 10); 
} 
+0

고마워요! –