コード例 #1
0
ファイル: TSImageLoading.cs プロジェクト: wonrst/TizenFX
        public void ImageLoadingDownloadImageSynchronously()
        {
            tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronously START");


            var testingTarget = ImageLoading.DownloadImageSynchronously(bmp_path);

            Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer.");
            Assert.IsInstanceOf <PixelBuffer>(testingTarget, "Should return PixelBuffer instance.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronously END (OK)");
        }
コード例 #2
0
ファイル: TSImageLoading.cs プロジェクト: yunmiha/TizenFX
        public void ImageLoadingDownloadImageSynchronouslyWithOrientationCorrection()
        {
            tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithOrientationCorrection START");

            using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height))
            {
                var testingTarget = ImageLoading.DownloadImageSynchronously(bmp_path, size2d, FittingModeType.Center, SamplingModeType.DontCare, true);
                Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer.");
                Assert.IsInstanceOf <PixelBuffer>(testingTarget, "Should return PixelBuffer instance.");

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyWithOrientationCorrection END (OK)");
        }
コード例 #3
0
        public void ImageLoadingDownloadImageSynchronouslyByNullUrl()
        {
            tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByNullUrl START");

            try
            {
                using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height))
                {
                    Uri uri = null;
                    ImageLoading.DownloadImageSynchronously(uri, size2d, FittingModeType.Center);
                }
            }
            catch (ArgumentNullException)
            {
                tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByNullUrl END (OK)");
                Assert.Pass("Caught ArgumentNullException : Passed!");
            }
        }
コード例 #4
0
        public void ImageLoadingDownloadImageSynchronouslyByUrl()
        {
            tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByUrl START");

            using (Size2D size2d = new Size2D(NUIApplication.GetDefaultWindow().WindowSize.Width, NUIApplication.GetDefaultWindow().WindowSize.Height))
            {
                var testingTarget = ImageLoading.DownloadImageSynchronously(new Uri(bmp_path), size2d, FittingModeType.Center);
                Assert.IsNotNull(testingTarget, "Can't create success object PixelBuffer.");
                Assert.IsInstanceOf <PixelBuffer>(testingTarget, "Should return PixelBuffer instance.");

                testingTarget.Dispose();
            }

            try
            {
                ImageLoading.DownloadImageSynchronously(new Uri(bmp_path), null, FittingModeType.FitHeight);
            }
            catch (ArgumentNullException)
            {
                tlog.Debug(tag, $"ImageLoadingDownloadImageSynchronouslyByUrl END (OK)");
                Assert.Pass("Caught ArgumentNullException : Passed!");
            }
        }