public MyApp(IWindowAttacher windowAttacher, INotifier notifier, IScreenHelper screenHelper, Container container) { //var d = new DebugWindow(screenHelper); //d.Show(); var t = new VideoTest(); t.Show(); _windowAttacher = windowAttacher; _notifier = notifier; _container = container; if (!Directory.Exists(BDMTConstants.WORKSPACE_NAME)) { Directory.CreateDirectory(BDMTConstants.WORKSPACE_NAME); } if (!File.Exists(BDMTConstants.WORKSPACE_PATH + BDMTConstants.NOTIFICATION_SOUND_FILE)) { File.WriteAllBytes(BDMTConstants.WORKSPACE_PATH + BDMTConstants.NOTIFICATION_SOUND_FILE, BDMultiTool.Properties.Resources.notifySound); } minimized = false; _windowAttacher.Attach(WindowAttacher.GetHandleByWindowTitleBeginningWith("BLACK DESERT")); appCoreIsInitialized = true; HookManager.KeyPress += HookManagerOnKeyPress; //letAllComponentsRegister(); }
public void PinvokeTests() { var handle = WindowAttacher.GetHandleByWindowTitleBeginningWith("BLACK DESERT"); var tmp = GraphicsFactory.CopyFromScreen(handle); Clipboard.SetImage(tmp); }
public void PinvokeCapturePerf() { var handle = WindowAttacher.GetHandleByWindowTitleBeginningWith("BLACK DESERT"); Debug.WriteLine(@"Start Perftest with 100 step"); var st = new Stopwatch(); st.Start(); for (var i = 0; i < 100; i++) { var bmp = GraphicsFactory.CopyFromScreen(handle); bmp.Dispose(); } st.Stop(); Debug.WriteLine(@"End Perftest with 100 step"); Debug.WriteLine($@"Total time {st.ElapsedMilliseconds} ms, average {st.ElapsedMilliseconds / 100}"); Debug.WriteLine(@"Start Perftest with 1000 step"); var st2 = new Stopwatch(); st2.Start(); for (var i = 0; i < 1000; i++) { var bmp = GraphicsFactory.CopyFromScreen(handle); bmp.Dispose(); } st2.Stop(); Debug.WriteLine(@"End Perftest with 1000 step"); Debug.WriteLine($@"Total time {st2.ElapsedMilliseconds} ms, average {st2.ElapsedMilliseconds / 1000}"); Debug.WriteLine(@"Start Perftest with 10000 step"); var st3 = new Stopwatch(); st3.Start(); for (var i = 0; i < 10000; i++) { var bmp = GraphicsFactory.CopyFromScreen(handle); bmp.Dispose(); } st3.Stop(); Debug.WriteLine(@"End Perftest with 10000 step"); Debug.WriteLine($@"Total time {st3.ElapsedMilliseconds} ms, average {st3.ElapsedMilliseconds / 10000}"); }
public App() { if (!Directory.Exists(BDMTConstants.WORKSPACE_NAME)) { Directory.CreateDirectory(BDMTConstants.WORKSPACE_NAME); } if (!File.Exists(BDMTConstants.WORKSPACE_PATH + BDMTConstants.NOTIFICATION_SOUND_FILE)) { File.WriteAllBytes(BDMTConstants.WORKSPACE_PATH + BDMTConstants.NOTIFICATION_SOUND_FILE, BDMultiTool.Properties.Resources.notifySound); } minimized = false; overlay = new Overlay(); windowAttacher = new WindowAttacher(WindowAttacher.getHandleByWindowTitleBeginningWith("Black Desert"), overlay); appCoreIsInitialized = true; letAllComponentsRegister(); }