-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoDrawCiercle.cs
62 lines (48 loc) · 1.37 KB
/
AutoDrawCiercle.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using WindowsInput;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
/*
class Program
{
[DllImport("user32.dll")]
public static extern bool GetCursorPos(out POINT lpPoint);
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int X;
public int Y;
}
static async Task Main()
{
POINT cursorPosition;
GetCursorPos(out cursorPosition);
await Task.Delay(5000);
InputSimulator s = new InputSimulator();
double x = 32750;
double y = 32750;
double r = 10000;
s.Mouse.MoveMouseTo(x + r, y);
s.Mouse.LeftButtonDown();
for (int i = 1; i < 360; i++)
{
double engle = i * Math.PI / 180;
double newX = x + r * Math.Cos(engle);
double newY = y + r * 1.78 * Math.Sin(engle);
s.Mouse.MoveMouseTo(newX, newY);
await Task.Delay(9);
}
s.Mouse.LeftButtonUp();
}
static void MouseClick(int x, int y)
{
InputSimulator sim = new InputSimulator();
sim.Mouse.MoveMouseTo(x,y);
sim.Mouse.LeftButtonClick();
}
static void KeyPress(string key)
{
InputSimulator sim = new InputSimulator();
sim.Keyboard.TextEntry(key);
}
}*/