コード例 #1
0
 public override void Test()
 {
     SA_ScreenUtil.TakeScreenshot((screenshot) => {
         AN_Gallery.SaveImageToGallery(screenshot, "Example Scnee", (result) => {
             if (result.IsSucceeded)
             {
                 AN_Logger.Log("Screenshot has been saved to:  " + result.Path);
             }
             SetAPIResult(result);
         });
     });
 }
コード例 #2
0
 public override void SaveImage(Texture2D image, string fileName, Action <SA_Result> callback)
 {
     AN_Gallery.SaveImageToGallery(image, fileName, callback.Invoke);
 }
コード例 #3
0
    private void Awake()
    {
        AddFitter(m_image.gameObject);
        AddFitter(m_sprite.gameObject);

        m_captureAdvanced.onClick.AddListener(() => {
            var maxSize = 1024;
            AN_Camera.CaptureImage(maxSize, (result) => {
                PrintCaptureResult(result);
            });
        });


        m_captureVideo.onClick.AddListener(() => {
            var maxSize = 1024;

            AN_Camera.CaptureVideo(maxSize, (result) => {
                PrintCaptureResult(result);
            });
        });



        m_getVideos.onClick.AddListener(() => {
            var picker = new AN_MediaPicker(AN_MediaType.Video);
            picker.AllowMultiSelect = true;
            picker.MaxSize          = 512;

            picker.Show((result) => {
                PrintPickerResult(result);
            });
        });


        m_getMixed.onClick.AddListener(() => {
            var picker = new AN_MediaPicker(AN_MediaType.Image, AN_MediaType.Video);
            picker.AllowMultiSelect = true;
            picker.MaxSize          = 512;

            picker.Show((result) => {
                PrintPickerResult(result);
            });
        });

        m_getPictures.onClick.AddListener(() => {
            var picker = new AN_MediaPicker(AN_MediaType.Image);

            // Defines if multiple images picker is allowed.
            // The default value is < c > false </ c >
            picker.AllowMultiSelect = true;

            // Max thumbnail size that will be transferred to the Unity side.
            // The thumbnail will be resized before it sent.
            // The default value is 512.
            picker.MaxSize = 512;

            // Starts pick media from a gallery flow.
            picker.Show((result) => {
                PrintPickerResult(result);
            });
        });



        m_saveScreenshot.onClick.AddListener(() => {
            SA_ScreenUtil.TakeScreenshot(512, (screenshot) => {
                AN_Gallery.SaveImageToGallery(screenshot, "ExampleScreenshot", (result) => {
                    if (result.IsFailed)
                    {
                        AN_Logger.Log("Filed:  " + result.Error.Message);
                        return;
                    }

                    AN_Logger.Log("Screenshot has been saved to:  " + result.Path);
                });
            });
        });
    }