반응형
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp3 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Bitmap screenCaptureBitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width , Screen.PrimaryScreen.Bounds.Height); Graphics g = Graphics.FromImage(screenCaptureBitmap); Size sz = new Size(Screen.PrimaryScreen.Bounds.Width , Screen.PrimaryScreen.Bounds.Height); g.CopyFromScreen(0, 0, 0, 0, sz); this.pictureBox1.Image = screenCaptureBitmap; } } }
'프로그래밍 > C#' 카테고리의 다른 글
[C#]드래그앤드롭 (0) | 2017.05.01 |
---|---|
[C#]PictureBox안에 있는 이미지 드래그로 이동시키기 (7) | 2017.04.28 |
[C#]소켓으로 이미지 전송하기 (2) | 2017.04.23 |
[C#]as is (0) | 2017.04.22 |
[C#]마지막 일자 구하기 (0) | 2017.04.20 |