Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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
epos{project}{project}inDebug )
    bitmap.Save("test.jpg", ImageFormat.Jpeg);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# how to check if two lists have same values 
Csharp :: c# unity follow object 
Csharp :: unity 2d joystick controls 
Csharp :: unity json save array 
Csharp :: unity change tmp text from script 
Csharp :: c# how to use inovke 
Csharp :: C# Console multi language 
Csharp :: how to convert from hexadecimal to binary in c# 
Csharp :: c# unity get lines 
Csharp :: wpf get screen size 
Csharp :: unity get scrollbar value 
Csharp :: unity clamp rotation 
Csharp :: unity set material 
Csharp :: get execution directory c# 
Csharp :: c# send email 
Csharp :: regular expression for email in c# 
Csharp :: print array in c# 
Csharp :: c# string.join 
Csharp :: c# inline if 
Csharp :: c# byte array to bitmap 
Csharp :: enum get all values c# 
Csharp :: convert comma separated string to array c# 
Csharp :: c# regex get matched string 
Csharp :: c# socket connect timeout 
Csharp :: c# md5 
Csharp :: c# environment variables 
Csharp :: read embedded resource c# xml 
Csharp :: c# console wait for input 
Csharp :: c# winforms textbox select text 
Csharp :: asp.net file detect mime type 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =