示例#1
0
 private void OnDestroy()
 {
     if (this == instance)
     {
         instance = null;
     }
 }
示例#2
0
 // 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);
     }
 }
示例#3
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         ScreenshotHandler.TakeScreenshot_Static(500, 500);
     }
 }
示例#4
0
    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
        }
    }
示例#5
0
    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
    }
示例#6
0
    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;
        }
    }
示例#7
0
 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);
     }
 }
示例#9
0
 // Update is called once per frame
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         ScreenshotHandler.TakeScreenshot_Static(Screen.width, Screen.height);
     }
 }
示例#10
0
 // 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);
     }
 }
示例#11
0
    //

    public void PngButtonControl()
    {
        if (GameObject.FindGameObjectWithTag("png"))
        {
            //
            ScreenshotHandler.TakeScreenshot_Static_Png(390, 703);
        }
    }
示例#12
0
 public void JpgButtonControl()
 {
     if (GameObject.FindGameObjectWithTag("jpg"))
     {
         //SeceneklerPnl.SetActive(false);
         ScreenshotHandler.TakeScreenshot_Static_Jpg(390, 703);
     }
 }
示例#13
0
        //Navigation method to URL
        public void navigateTo(string baseUrl)
        {
            driver.Navigate().GoToUrl(baseUrl);

            driver.Manage().Window.Maximize();

            ScreenshotHandler.captureScreenshot(driver);
        }
示例#14
0
 public void TearDown()
 {
     if ((TestContext.CurrentContext.Result.Outcome != ResultState.Success) &&
         (InstanceManager.CurrentInstance?.CurrentSession != null))
     {
         ScreenshotHandler.TakeScreenshot(InstanceManager.CurrentInstance.CurrentSession);
     }
 }
示例#15
0
 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);
 }
示例#16
0
    IEnumerator CaptureIt()
    {
        blink.SetActive(true);
        ScreenshotHandler.TakeScreenshot_Static(2560, 1440);
        yield return(new WaitForSeconds(0.04f));

        blink.SetActive(false);
    }
示例#17
0
 // 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();
     }
 }
示例#18
0
 private void Awake()
 {
     instance = this;
     if (_camera == null)
     {
         _camera = GetComponent <Camera>();
     }
     Debug.Log("screnshot camera");
 }
示例#19
0
 /// <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;
    }
示例#21
0
        //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;
 }
示例#23
0
        //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);
        }
示例#24
0
        public void searchFor(String searchTerm)
        {
            waitForElementBy(inputFieldSelector);

            IWebElement query = driver.FindElement(inputFieldSelector);

            query.SendKeys(searchTerm);
            query.Submit();

            ScreenshotHandler.captureScreenshot(driver);
        }
示例#25
0
    IEnumerator AutoSave()
    {
        while (!reload)
        {
            yield return(new WaitForSeconds(autoSaveTime));

            StartCoroutine(AutoSaveBox());
            Save();
            ScreenshotHandler.TakeScreenshot_Static(512, 512);
        }
    }
示例#26
0
    private void Awake()
    {
        if (instance)
        {
            Destroy(gameObject);
            return;
        }

        instance         = this;
        screenShotCamera = GetComponent <Camera>();
        screenShotPath   = Application.dataPath;
    }
示例#27
0
    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));
    }
示例#28
0
 // 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);
     }
 }
示例#29
0
    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
    }
示例#30
0
        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();
        }