Advertisement
Fhernd

Principal.cs

Mar 13th, 2018
1,258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4.  
  5. namespace R806CapturaPantalla
  6. {
  7.     public partial class Principal : Form
  8.     {
  9.         public Principal()
  10.         {
  11.             InitializeComponent();
  12.         }
  13.  
  14.         private void btnCapturarPantalla_Click(object sender, EventArgs e)
  15.         {
  16.             Bitmap bmpCapturaPantalla = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
  17.  
  18.             using (Graphics g = Graphics.FromImage(bmpCapturaPantalla))
  19.             {
  20.                 g.CopyFromScreen(0, 0, 0, 0, bmpCapturaPantalla.Size);
  21.             }
  22.  
  23.             pbxCapturaPantalla.Image = bmpCapturaPantalla;
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement