듀얼 스크린 Capture
꽁스짱
C#
0
2241
2021.07.15 15:42
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MyCapture
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Button1_Click(object sender, EventArgs e)
{
Rectangle rc = new Rectangle();
foreach (var item in Screen.AllScreens)
{
rc = Rectangle.Union(rc, item.Bounds);
}
Bitmap bmp = new Bitmap(rc.Width, rc.Height);
using (Graphics g = Graphics.FromImage(bmp))
{
g.CopyFromScreen(rc.Location, Point.Empty, bmp.Size);
}
bmp.Save(@"sshot.png", ImageFormat.Png);
}
}
}