Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# draw rectangle on screen

using System.Drawing;
using System.Runtime.InteropServices;
        [DllImport("User32.dll")]
        public static extern IntPtr GetDC(IntPtr hwnd);
        [DllImport("User32.dll")]
        public static extern void ReleaseDC(IntPtr hwnd, IntPtr dc); 

IntPtr desktopPtr = GetDC(IntPtr.Zero);
                Graphics g = Graphics.FromHdc(desktopPtr);


                SolidBrush b = new SolidBrush(Color.White);
                g.FillRectangle(b, new Rectangle(0, 0, 1920, 1080));

                ReleaseDC(IntPtr.Zero, desktopPtr);
                g.Dispose();
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# make file not read only 
Csharp :: nexo price 
Csharp :: c# add key value pair to dictionary 
Csharp :: static class can have non static member in c# 
Csharp :: check file lock c# 
Csharp :: list sum c# 
Csharp :: unity input system 
Csharp :: c# wpf row definition height * in code 
Csharp :: how to turn components on and off in unity through code 
Csharp :: defining vectors in c# 
Csharp :: declare enum c# 
Csharp :: unity master volume changer 
Csharp :: c# iterate sorteddictionary 
Csharp :: delete all rows from table mvc 
Csharp :: enum in c# 
Csharp :: How to search values in the registry 
Csharp :: timer unity 
Csharp :: c# split include separators 
Csharp :: c# generic return type in interface 
Csharp :: properties in c# 
Csharp :: c# array zaheln speichern 
Csharp :: c# caractère cacher mot de passe 
Csharp :: c# window form align right bottom 
Csharp :: how to hide the title bar of window in monogame 
Csharp :: c# substring find word 
Csharp :: c# invokerequired wpf 
Csharp :: c# how to delete all files in directory 
Csharp :: c# lambda group by multiple columns 
Csharp :: Unity upload image to project 
Csharp :: unity awake 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =