Horje
take screenshot in c# Code Example
take screenshot in c#
using System.Windows.Forms; 
using Point = System.Drawing.Point;
using Rectangle = System.Drawing.Rectangle;
Rectangle bounds = Screen.GetBounds(Point.Empty);

using(Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
{
    using(Graphics g = Graphics.FromImage(bitmap))
    {
         g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
    }
    // will save to working directory  ( for C# WPF in VS 2019: C:\Users\{user}\source\repos\{project}\{project}\bin\Debug )
    bitmap.Save("test.jpg", ImageFormat.Jpeg);
}




Csharp

Related
c# string to byte[] Code Example c# string to byte[] Code Example
c# read from file Code Example c# read from file Code Example
enum element count C# Code Example enum element count C# Code Example
c# size of enum Code Example c# size of enum Code Example
how to use file watcher in c# Code Example how to use file watcher in c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9