달력

102025  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
반응형
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
Posted by 유령회사
|