Пример #1
0
    private IEnumerator LateSaveCapturedPhoto(string photoPath)
    {
        yield return(null);

        Debug.Log("CaptureDeviceCamHandle on path: " + photoPath);
        byte[] bytes = File.ReadAllBytes(photoPath);
        File.Delete(photoPath);

        Sprite photoSprite = SpriteLoader.GetSpriteFromBytes(bytes);

        if (photoSprite == null)
        {
            Debug.LogError("CaptureDeviceCam complete, but sprite is null in path:\n" +
                           photoPath);
            yield break;
        }

        Sprite rotatedSprite = TextureRotator.RotateSprite(photoSprite);

        bytes = rotatedSprite.texture.EncodeToJPG();
        string photoName = "Vsm-Appraiser-devicePhoto-" + DateStringConverter.GetMDHMSMDate() + ".jpg";

        photoPath = Path.Combine(GlobalSettings.cloudStorageUploadPath, photoName);
        File.WriteAllBytes(photoPath, bytes);
        Debug.Log("CaptureDeviceCamHandle replaced by new path " + photoPath);

        //CardAdditionalScreen.DeviceCameraCaptureHandle(photoPath, rotatedSprite);
    }