private void OnDestroy() { if (this == instance) { instance = null; } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKey(KeyCode.LeftArrow)) { // rotate the camera and take a screenshot cam.MoveHorizontal(true); ScreenshotHandler.TakeScreenshot_Static(1000, 1000); Debug.Log(cam.transform.eulerAngles); } else if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKey(KeyCode.RightArrow)) { cam.MoveHorizontal(false); ScreenshotHandler.TakeScreenshot_Static(1000, 1000); } else if (Input.GetKeyDown(KeyCode.UpArrow)) { cam.MoveVertical(true); // ScreenshotHandler.TakeScreenshot_Static(1000, 1000); Debug.Log(cam.transform.eulerAngles.x); } else if (Input.GetKeyDown(KeyCode.DownArrow)) { cam.MoveVertical(false); // ScreenshotHandler.TakeScreenshot_Static(1000, 1000); Debug.Log(cam.transform.eulerAngles.x); } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { ScreenshotHandler.TakeScreenshot_Static(500, 500); } }
public void Share(string message, Texture2D image = null) { if (image != null) { MyImage = image; #if UNITY_ANDROID //StartCoroutine (SaveAndShare ()); StartCoroutine(NativeShareCoroutine()); #elif UNITY_IOS || UNITY_IPAD byte[] bytes = MyImage.EncodeToPNG(); string path = Application.persistentDataPath + "/MyImage.png"; File.WriteAllBytes(path, bytes); string path_ = "MyImage.png"; StartCoroutine(ScreenshotHandler.Save(path_, "Media Share", true)); #endif } }
IEnumerator UploadPNG() { // We should only read the screen buffer after rendering is complete yield return(new WaitForEndOfFrame()); // Create a texture the size of the screen, RGB24 format int width = Screen.width; int height = Screen.height; Texture2D tex = new Texture2D(width, height, TextureFormat.RGB24, false); // Read screen contents into the texture tex.ReadPixels(new Rect(0, 0, width, height), 0, 0); tex.Apply(); // Encode texture into PNG byte[] bytes = tex.EncodeToPNG(); string path = Application.persistentDataPath + "/MyImage.png"; File.WriteAllBytes(path, bytes); string path_ = "MyImage.png"; Debug.Log("SCRENSHOT TAKEN"); #if UNITY_IPHONE || UNITY_IPAD StartCoroutine(ScreenshotHandler.Save(path_, "Media Share", true)); #elif UNITY_ANDROID StartCoroutine(SaveAndShare()); #endif }
void Start() { //height = width; instance = this; //myCamera = gameObject.GetComponent<Camera>(); shutterSound = GetComponent <AudioSource>(); AudioManager = GameObject.Find("---AudioManager").GetComponent <AudioManager>(); ScreenCapDirectory = Application.persistentDataPath; FinalCameraController = GetComponent <FinalCameraController>(); //CalculateInventory = GameObject.Find("---InventoryController").GetComponent<CalculateInventory>(); RatingSys = GameObject.Find("FloatingUI").GetComponent <RatingSystem>(); if (FinalCameraController != null) { AdsController = GameObject.Find("---AdsController").GetComponent <AdsController>(); } // postImage = GetComponent<Image>(); // //print(postImage.name); if (!FinalCameraController.isTutorial) { //KararaTop = KararaTopImage.sprite.name; //KararaBottom = KararaBottomImage.sprite.name; //KararaShoe = KararaShoeImage.sprite.name; } }
private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { ScreenshotHandler.TakeScreenshot_Static(1024, 768); } }
void Update() { if (Input.GetKeyDown(KeyCode.F8)) { ScreenshotHandler.TakeScreenshot_Static(1024, 1024); } }
// Update is called once per frame private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { ScreenshotHandler.TakeScreenshot_Static(Screen.width, Screen.height); } }
// Update is called once per frame void Update() { // Use Spacebar key to take a screenshot if (Input.GetKeyDown(KeyCode.Space)) { ScreenshotHandler.TakeScreenshot_Static(1000, 1000); } }
// public void PngButtonControl() { if (GameObject.FindGameObjectWithTag("png")) { // ScreenshotHandler.TakeScreenshot_Static_Png(390, 703); } }
public void JpgButtonControl() { if (GameObject.FindGameObjectWithTag("jpg")) { //SeceneklerPnl.SetActive(false); ScreenshotHandler.TakeScreenshot_Static_Jpg(390, 703); } }
//Navigation method to URL public void navigateTo(string baseUrl) { driver.Navigate().GoToUrl(baseUrl); driver.Manage().Window.Maximize(); ScreenshotHandler.captureScreenshot(driver); }
public void TearDown() { if ((TestContext.CurrentContext.Result.Outcome != ResultState.Success) && (InstanceManager.CurrentInstance?.CurrentSession != null)) { ScreenshotHandler.TakeScreenshot(InstanceManager.CurrentInstance.CurrentSession); } }
private ProcessHandler(IntPtr foregroundHWnd, IntPtr windowRectHWnd, IntPtr screenshotHWnd, IntPtr keyboardHWnd, IntPtr mouseHWnd) { _foreground = new ForegroundHandler(foregroundHWnd); _windowRect = new WindowRectHandler(windowRectHWnd); _screenshot = new ScreenshotHandler(screenshotHWnd); _keyboard = new KeyboardHandler(keyboardHWnd); _mouse = new MouseHandler(mouseHWnd); }
IEnumerator CaptureIt() { blink.SetActive(true); ScreenshotHandler.TakeScreenshot_Static(2560, 1440); yield return(new WaitForSeconds(0.04f)); blink.SetActive(false); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space)) { //ScreenshotHandler.TakeScreenshot_Static(224,224); ScreenshotHandler.TakeScreenshot_Static(448, 448, "data/output/haha.png"); //MakePictures.MakeAllPictures(); } }
private void Awake() { instance = this; if (_camera == null) { _camera = GetComponent <Camera>(); } Debug.Log("screnshot camera"); }
/// <summary> /// Инициализируем скриншоты и отправку писем. /// </summary> public static void Process() { AppDomain.CurrentDomain.UnhandledException += (sender, args) => { ScreenshotHandler.CreateScheenshot(); var error = args.ExceptionObject.ToString(); var information = GetSystemInformation(error); EmailHandler.Send(information); }; }
private void Awake() { if (instance) { Destroy(gameObject); return; } instance = this; }
//general method to sendKeys to a webelement public void actionSendKeys(By bySelector, String text) { waitForElementBy(bySelector); IWebElement sendKeysWE = driver.FindElement(bySelector); sendKeysWE.SendKeys(text); //TODO remove repoting screenCapture if extentReports are used ScreenshotHandler.captureScreenshot(driver); }
private void OnDestroy() { if (instance == this) { instance = null; } InputManager.Input.PlayerGhost.TakePicture.performed -= OnScreenshot; InputManager.Input.PlayerGhost.PhotoMode.started -= ChangePhotoMode; InputManager.Input.PlayerGhost.PhotoMode.canceled -= ChangePhotoMode; }
//general method to click on a webelement public void actionClick(By bySelector) { waitForElementBy(bySelector); IWebElement clickableWE = driver.FindElement(bySelector); clickableWE.Click(); //TODO remove repoting screenCapture if extentReports are used ScreenshotHandler.captureScreenshot(driver); }
public void searchFor(String searchTerm) { waitForElementBy(inputFieldSelector); IWebElement query = driver.FindElement(inputFieldSelector); query.SendKeys(searchTerm); query.Submit(); ScreenshotHandler.captureScreenshot(driver); }
IEnumerator AutoSave() { while (!reload) { yield return(new WaitForSeconds(autoSaveTime)); StartCoroutine(AutoSaveBox()); Save(); ScreenshotHandler.TakeScreenshot_Static(512, 512); } }
private void Awake() { if (instance) { Destroy(gameObject); return; } instance = this; screenShotCamera = GetComponent <Camera>(); screenShotPath = Application.dataPath; }
public void OniOSTwitterMediaSharing() { Debug.Log("Media Share"); byte[] bytes = MyImage.EncodeToPNG(); string path = Application.persistentDataPath + "/MyImage.png"; File.WriteAllBytes(path, bytes); string path_ = "MyImage.png"; StartCoroutine(ScreenshotHandler.Save(path_, "Media Share", true)); }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { //ReturnToMenu(); GUIManager.instance.activatePauseMenu(); } if (Input.GetKeyDown(KeyCode.Space)) { // ScreenshotHandler.TakeScreenShot_Static(Screen.width, Screen.height); ScreenshotHandler.TakeScreenShot_Static(1920, 1080); } }
public void OnShareTextWithLinkImage(string url, Vector2 size) { #if UNITY_ANDROID StartCoroutine(CaptureImage(url, size)); #elif UNITY_IPHONE || UNITY_IPAD byte[] bytes = MyImage.EncodeToPNG(); string path = Application.persistentDataPath + "/MyImage.png"; File.WriteAllBytes(path, bytes); string path_ = "MyImage.png"; StartCoroutine(ScreenshotHandler.Save(path_, "Media Share", true)); #endif }
public void EndTest() { ScreenshotHandler.MakeScreenshot(TestContext.CurrentContext, driver); driver.Close(); foreach (var brand in context.Brands.Where(x => x.BrandName == TestSettings.brandName)) { context.Brands.Remove(brand); } context.SaveChanges(); context.Dispose(); }