public MainWindow() { InitializeComponent(); Screenshoter = new Screenshoter(); Video = new VideoMaker(); Timer = new DispatcherTimer(); }
/// <summary> /// Creates screenshot of all available screens. <br/> /// If <paramref name="rectangle"/> is not null, returns image of this region. /// </summary> /// <param name="rectangle"></param> /// <param name="cancellationToken"></param> /// <returns></returns> public async Task <Bitmap> ShotAsync( Rectangle?rectangle = null, CancellationToken cancellationToken = default) { return(await Screenshoter.ShotAsync(rectangle, cancellationToken) .ConfigureAwait(false)); }
protected override async Task <bool> OnResultAsync() { using (var image = await Screenshoter.ShotVirtualDisplayAsync()) // TODO: shot main display ? using (var bitmap = new Bitmap(image)) { return(Analyze(bitmap)); } }
public async Task AsyncMultiShotTest() { using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); var cancellationToken = cancellationTokenSource.Token; await Task.WhenAll(Enumerable .Range(0, 10) .Select(_ => Screenshoter.ShotAsync(cancellationToken: cancellationToken))); }
public CheckAuthorAndTitleInYoutubeVideo(ScenarioContext scenarioContext) { if (scenarioContext == null) { throw new ArgumentNullException("scenarioContext"); } this.scenarioContext = scenarioContext; screenshoter = new Screenshoter(scenarioContext, BrowserContainer.GetBrowser(scenarioContext.ScenarioInfo.Title).Driver); page = new YouTubePage(BrowserContainer.GetBrowser(scenarioContext.ScenarioInfo.Title)); }
private void OnEnable() { lastTimeScale = null; t = target as Screenshoter; list = new ReorderableList(serializedObject, serializedObject.FindProperty("resolutions"), false, false, true, true); list.drawElementCallback = (rect, index, isActive, isFocused) => { DrawElement(list.serializedProperty.GetArrayElementAtIndex(index), rect, index, isActive, isFocused); }; currentResolution = list.index = t.SelectedResolutionIndex(); }
public void InverseRectangleShotTest() { var bitmap = Screenshoter.Shot(Rectangle.FromLTRB(5278, 1426, 4509, 808)); var path = $"{Path.GetTempFileName()}.bmp"; bitmap.Save(path); Process.Start(new ProcessStartInfo(path) { UseShellExecute = true, }); }
public void ShotTest() { var bitmap = Screenshoter.Shot(); var path = $"{Path.GetTempFileName()}.bmp"; bitmap.Save(path); Process.Start(new ProcessStartInfo(path) { UseShellExecute = true, }); }
void Start() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } CreateFolder(); }
public void ShotEachDisplayTest() { foreach (var rectangle in Screenshoter.GetPhysicalScreens()) { var bitmap = Screenshoter.Shot(rectangle); var path = $"{Path.GetTempFileName()}.bmp"; bitmap.Save(path); Process.Start(new ProcessStartInfo(path) { UseShellExecute = true, }); } }
public async Task AsyncShotTest() { using var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30)); var cancellationToken = cancellationTokenSource.Token; var bitmap = await Screenshoter.ShotAsync(cancellationToken : cancellationToken); var path = $"{Path.GetTempFileName()}.bmp"; bitmap.Save(path); Process.Start(new ProcessStartInfo(path) { UseShellExecute = true, }); }
public override void OnInspectorGUI() { DrawDefaultInspector(); Screenshoter ScreenshoterScript = (Screenshoter)target; GUILayout.Space(20); if (GUILayout.Button("Take Screenshot")) { ScreenshoterScript.TakeEditorScreenshot(); } if (GUILayout.Button("Open Folder")) { ScreenshoterScript.OpenFolder(); } GUILayout.Space(10); }
private void MakeScreenshot() { var screenPath = new Screenshoter(this.App.Pages.Driver).TakeScreenshot( TestContext.CurrentContext.Test.MethodName, TestContext.CurrentContext.TestDirectory + "\\Logs"); if (!string.IsNullOrEmpty(screenPath)) { // this.App.Logger.Info("Screenshot {rp#file# " + screenPath + "}"); //temporary to check screens from azure agent this.App.Logger.Info("Screenshot {" + screenPath + "}"); Bridge.LogMessage(ReportPortal.Client.Models.LogLevel.Info, "Screenshot {rp#file#" + screenPath + "}"); } else { this.App.Logger.Warn("Can't make screenshot"); } }
public void CloseApplication() { Screenshoter.TakeFullScreenshot(); FApplication.Instance.CloseApplication(); }
public void TakeScreenshot() { Screenshoter.TakeScreenshot(); }
private void dispatcherTimer_Tick(object sender, EventArgs e) { Video.AddFrame(Screenshoter.TakeScreenshot(Screen.PrimaryScreen)); }
private static void ScreenshotersInit() { screenshoter = new Screenshoter(); }