Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95a9e2e

Browse files
committed
initial anime ml recognition commit
1 parent 359c25e commit 95a9e2e

73 files changed

Lines changed: 8192 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
*.png
3+
4+
**/Images

Screenshot/Program.cs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
using System.Drawing.Imaging;
2+
using System.Drawing;
3+
using System;
4+
using System.Runtime.InteropServices;
5+
using System.Threading;
6+
7+
public class Screenshot
8+
{
9+
const string filePath = "filePath";
10+
11+
//https://stackoverflow.com/questions/1163761/capture-screenshot-of-active-window
12+
[DllImport("user32.dll")]
13+
private static extern IntPtr GetForegroundWindow();
14+
15+
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
16+
public static extern IntPtr GetDesktopWindow();
17+
18+
[StructLayout(LayoutKind.Sequential)]
19+
private struct Rect
20+
{
21+
public int Left;
22+
public int Top;
23+
public int Right;
24+
public int Bottom;
25+
}
26+
27+
[DllImport("user32.dll")]
28+
private static extern IntPtr GetWindowRect(IntPtr hWnd, ref Rect rect);
29+
30+
public static Image CaptureDesktop()
31+
{
32+
return CaptureWindow(GetDesktopWindow());
33+
}
34+
35+
public static Bitmap CaptureActiveWindow()
36+
{
37+
return CaptureWindow(GetForegroundWindow());
38+
}
39+
40+
public static Bitmap CaptureWindow(IntPtr handle)
41+
{
42+
var rect = new Rect();
43+
GetWindowRect(handle, ref rect);
44+
var bounds = new Rectangle(rect.Left, rect.Top, rect.Right - rect.Left, rect.Bottom - rect.Top);
45+
var result = new Bitmap(bounds.Width, bounds.Height);
46+
47+
using (var graphics = Graphics.FromImage(result))
48+
{
49+
graphics.CopyFromScreen(new Point(bounds.Left, bounds.Top), Point.Empty, bounds.Size);
50+
}
51+
52+
return result;
53+
}
54+
55+
public Screenshot()
56+
{
57+
58+
}
59+
public static void StartScreenCapture()
60+
{
61+
int count = 0;
62+
while (true)
63+
{
64+
var image = CaptureDesktop();
65+
string imgName = filePath + count + ".png";
66+
image.Save(imgName, ImageFormat.Png);
67+
Thread.Sleep(1000);
68+
count++;
69+
}
70+
71+
}
72+
public static void Main()
73+
{
74+
StartScreenCapture();
75+
}
76+
}

Screenshot/Screenshot.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
10+
</ItemGroup>
11+
12+
</Project>
Binary file not shown.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"runtimeTarget": {
3+
"name": ".NETCoreApp,Version=v3.1",
4+
"signature": ""
5+
},
6+
"compilationOptions": {},
7+
"targets": {
8+
".NETCoreApp,Version=v3.1": {
9+
"Screenshot/1.0.0": {
10+
"dependencies": {
11+
"System.Drawing.Common": "4.7.0"
12+
},
13+
"runtime": {
14+
"Screenshot.dll": {}
15+
}
16+
},
17+
"Microsoft.NETCore.Platforms/3.1.0": {},
18+
"Microsoft.Win32.SystemEvents/4.7.0": {
19+
"dependencies": {
20+
"Microsoft.NETCore.Platforms": "3.1.0"
21+
},
22+
"runtime": {
23+
"lib/netstandard2.0/Microsoft.Win32.SystemEvents.dll": {
24+
"assemblyVersion": "4.0.2.0",
25+
"fileVersion": "4.700.19.56404"
26+
}
27+
},
28+
"runtimeTargets": {
29+
"runtimes/win/lib/netcoreapp3.0/Microsoft.Win32.SystemEvents.dll": {
30+
"rid": "win",
31+
"assetType": "runtime",
32+
"assemblyVersion": "4.0.2.0",
33+
"fileVersion": "4.700.19.56404"
34+
}
35+
}
36+
},
37+
"System.Drawing.Common/4.7.0": {
38+
"dependencies": {
39+
"Microsoft.NETCore.Platforms": "3.1.0",
40+
"Microsoft.Win32.SystemEvents": "4.7.0"
41+
},
42+
"runtime": {
43+
"lib/netstandard2.0/System.Drawing.Common.dll": {
44+
"assemblyVersion": "4.0.0.1",
45+
"fileVersion": "4.6.26919.2"
46+
}
47+
},
48+
"runtimeTargets": {
49+
"runtimes/unix/lib/netcoreapp3.0/System.Drawing.Common.dll": {
50+
"rid": "unix",
51+
"assetType": "runtime",
52+
"assemblyVersion": "4.0.2.0",
53+
"fileVersion": "4.700.19.56404"
54+
},
55+
"runtimes/win/lib/netcoreapp3.0/System.Drawing.Common.dll": {
56+
"rid": "win",
57+
"assetType": "runtime",
58+
"assemblyVersion": "4.0.2.0",
59+
"fileVersion": "4.700.19.56404"
60+
}
61+
}
62+
}
63+
}
64+
},
65+
"libraries": {
66+
"Screenshot/1.0.0": {
67+
"type": "project",
68+
"serviceable": false,
69+
"sha512": ""
70+
},
71+
"Microsoft.NETCore.Platforms/3.1.0": {
72+
"type": "package",
73+
"serviceable": true,
74+
"sha512": "sha512-z7aeg8oHln2CuNulfhiLYxCVMPEwBl3rzicjvIX+4sUuCwvXw5oXQEtbiU2c0z4qYL5L3Kmx0mMA/+t/SbY67w==",
75+
"path": "microsoft.netcore.platforms/3.1.0",
76+
"hashPath": "microsoft.netcore.platforms.3.1.0.nupkg.sha512"
77+
},
78+
"Microsoft.Win32.SystemEvents/4.7.0": {
79+
"type": "package",
80+
"serviceable": true,
81+
"sha512": "sha512-mtVirZr++rq+XCDITMUdnETD59XoeMxSpLRIII7JRI6Yj0LEDiO1pPn0ktlnIj12Ix8bfvQqQDMMIF9wC98oCA==",
82+
"path": "microsoft.win32.systemevents/4.7.0",
83+
"hashPath": "microsoft.win32.systemevents.4.7.0.nupkg.sha512"
84+
},
85+
"System.Drawing.Common/4.7.0": {
86+
"type": "package",
87+
"serviceable": true,
88+
"sha512": "sha512-v+XbyYHaZjDfn0ENmJEV1VYLgGgCTx1gnfOBcppowbpOAriglYgGCvFCPr2EEZyBvXlpxbEsTwkOlInl107ahA==",
89+
"path": "system.drawing.common/4.7.0",
90+
"hashPath": "system.drawing.common.4.7.0.nupkg.sha512"
91+
}
92+
}
93+
}
6 KB
Binary file not shown.
171 KB
Binary file not shown.
9.73 KB
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"runtimeOptions": {
3+
"additionalProbingPaths": [
4+
"C:\\Users\\lifer\\.dotnet\\store\\|arch|\\|tfm|",
5+
"C:\\Users\\lifer\\.nuget\\packages"
6+
]
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"runtimeOptions": {
3+
"tfm": "netcoreapp3.1",
4+
"framework": {
5+
"name": "Microsoft.NETCore.App",
6+
"version": "3.1.0"
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)