c# windows grab screenshot
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);
}private Bitmap GetSreenshot()
{
Bitmap bm = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics g = Graphics.FromImage(bm);
g.CopyFromScreen(0, 0, 0, 0, bm.Size);
return bm;
}
Also in C#:
- Title
- unity cast float to int
- Category
- C#
- Title
- collision detector unity c# 2d
- Category
- C#
- Title
- using serial port in c#
- Category
- C#
- Title
- native-googlesignin configuration is null!?
- Category
- C#
- Title
- to list c#
- Category
- C#
- Title
- or in unity c#
- Category
- C#
- Title
- odbc command parameters c#
- Category
- C#
- Title
- array to list C
- Category
- C#
- Title
- c# get all class properties
- Category
- C#
- Title
- get day month year from date c#
- Category
- C#
- Title
- c sharp string interpolation
- Category
- C#
- Title
- c# how to add newline on text box
- Category
- C#
- Title
- unity to integer
- Category
- C#
- Title
- convert string array to int C#
- Category
- C#
- Title
- how to reduce garbage collection c#
- Category
- C#
- Title
- hot to move pobject unity
- Category
- C#
- Title
- trello
- Category
- C#
- Title
- bitmap to byte array c#
- Category
- C#
- Title
- c# remove last character from string
- Category
- C#
- Title
- object escape player unity
- Category
- C#
- Title
- c# making a folder
- Category
- C#
- Title
- how to edit a c# list
- Category
- C#
- Title
- phone
- Category
- C#
- Title
- c# multiple catch exceptions
- Category
- C#
- Title
- how to reference scripts in other scenes unity
- Category
- C#
- Title
- c# get current directory xamarin
- Category
- C#
- Title
- sum of digits in c#
- Category
- C#
- Title
- c# int
- Category
- C#
- Title
- mailkit send attachment
- Category
- C#
- Title
- unity timer with miliseconds
- Category
- C#
- Title
- C# events
- Category
- C#
- Title
- c# combobox datasource enum
- Category
- C#
- Title
- Assets\playermove.cs(30,37): error CS1003: Syntax error, ',' expected
- Category
- C#
- Title
- iframe set html content c#
- Category
- C#
- Title
- if get key down unity
- Category
- C#
- Title
- console.writeline
- Category
- C#
- Title
- C# loop through array of objet
- Category
- C#
- Title
- make a list c#
- Category
- C#
- Title
- radians to degree c#
- Category
- C#
- Title
- c# index in select
- Category
- C#
- Title
- unity c# write line
- Category
- C#
- Title
- Move player on planets in unity 2d
- Category
- C#
- Title
- c# get enum in list
- Category
- C#
- Title
- c# unity rotate first person controller script
- Category
- C#
- Title
- foreach syntax c#
- Category
- C#
- Title
- how to hide a panel ui unity
- Category
- C#
- Title
- c# replace string case insensitive
- Category
- C#
- Title
- xamarin hide back button
- Category
- C#
- Title
- c# how to use inovke
- Category
- C#
- Title
- c# reverse string
- Category
- C#
- Title
- install .net sdk ubuntu 20
- Category
- C#
- Title
- linq query select top 1 c#
- Category
- C#
- Title
- c# print to console
- Category
- C#
- Title
- json tiers dot in name c#
- Category
- C#
- Title
- ecs get specific entities with component
- Category
- C#
- Title
- asp.net mvc return file
- Category
- C#
- Title
- gfortran: declare an array
- Category
- C#
- Title
- unity jump
- Category
- C#
- Title
- dto and automapper
- Category
- C#
- Title
- perlin noise unity
- Category
- C#
- Title
- how to sort string array alphabetically in c#
- Category
- C#
- Title
- unity how to get transform scale
- Category
- C#
- Title
- c# docstring
- Category
- C#
- Title
- Request.Form
- Category
- C#
- Title
- get string character by index c#
- Category
- C#
- Title
- error CS0542
- Category
- C#
- Title
- convert base64 string to string c#
- Category
- C#
- Title
- button color uwp c#
- Category
- C#
- Title
- never lose focus textbox c#
- Category
- C#
- Title
- c# prime factorization
- Category
- C#
- Title
- c# write to console
- Category
- C#
- Title
- Replaced OS is obselete
- Category
- C#
- Title
- display none asp.net
- Category
- C#
- Title
- make camera follow character unity 2020
- Category
- C#
- Title
- c# multi threading example
- Category
- C#
- Title
- initialise icollection c#
- Category
- C#
- Title
- vector3.lerp
- Category
- C#
- Title
- c# list string return concatenate
- Category
- C#
- Title
- c# superclass constructor
- Category
- C#
- Title
- how consider the first caracter in Split c#
- Category
- C#
- Title
- how to clear console through script unity
- Category
- C#
- Title
- mongodb c# batch find
- Category
- C#
- Title
- resize image c#
- Category
- C#
- Title
- asking for user input integer c#
- Category
- C#
- Title
- c# empty array
- Category
- C#
- Title
- Unity3d GPS code
- Category
- C#
- Title
- set label position winforms
- Category
- C#
- Title
- unity add sections to a list
- Category
- C#
- Title
- c# property get set
- Category
- C#
- Title
- c# check to see if dictionary key exists
- Category
- C#
- Title
- datatable return column names
- Category
- C#
- Title
- c# length of array
- Category
- C#
- Title
- setting the parent of a transform which resides in a prefab
- Category
- C#
- Title
- windows form rounded corners
- Category
- C#
- Title
- get set c#
- Category
- C#
- Title
- how to make a game
- Category
- C#
- Title
- c# close window
- Category
- C#
- Title
- configure 1 to 1 relation ef
- Category
- C#
- Title
- how to find the type of a object c#
- Category
- C#
- Title
- decalre an int list mvc
- Category
- C#