15 lines
1.5 KiB
C#
15 lines
1.5 KiB
C#
using System; using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Drawing;
|
|
using System.Text.Json.Nodes;
|
|
using JJServiceManager.Remote;
|
|
namespace JJServiceManager { public enum LogLevel { Info, Success, Warning, Error, Notice } }
|
|
namespace JJServiceManager.Remote {
|
|
// 테스트용 가짜 화면 (Linux)
|
|
public sealed class MonitorInfo { public int Index{get;set;} public string Name{get;set;}=""; public int X{get;set;} public int Y{get;set;} public int Width{get;set;} public int Height{get;set;} public bool Primary{get;set;} }
|
|
public static class ScreenCapture {
|
|
public static List<MonitorInfo> Monitors()=> new(){ new MonitorInfo{Index=1,Width=1920,Height=1080,Primary=true}, new MonitorInfo{Index=2,Width=1280,Height=1024} };
|
|
public static Rectangle Area(int m)=> m==2? new Rectangle(1920,0,1280,1024) : new Rectangle(0,0,1920,1080);
|
|
static int n; public static byte[] CaptureJpeg(Rectangle a,int mw,long q,out int w,out int h,out ulong hash){ w=a.Width; h=a.Height; hash=(ulong)(Interlocked.Increment(ref n)/5); return new byte[]{1,2,3,(byte)a.Width}; }
|
|
}
|
|
public static class InputInjector { public static List<string> Got=new(); public static void Mouse(Rectangle a,double x,double y,string act,string b,int d){ lock(Got) Got.Add($"mouse {act} {b} {x:0.00},{y:0.00} area={a.Width}"); } public static void Key(int vk,bool down){ lock(Got) Got.Add($"key {vk} {(down?"down":"up")}"); } }
|
|
}
|