コード例 #1
0
        public void Initialize()
        {
            _bitmap = new SoftwareBitmap(BitmapPixelFormat.Rgba8, 1, 1);
            IResourceReleaser <SoftwareBitmap> resourceReleaser = SimpleBitmapReleaser.Instance;

            _closeableStaticBitmap = new CloseableStaticBitmap(
                _bitmap, resourceReleaser, ImmutableQualityInfo.FULL_QUALITY, 0);
        }
コード例 #2
0
        public void Initialize()
        {
            _bitmap           = new SoftwareBitmap(BitmapPixelFormat.Rgba8, 50, 50);
            _releaseCallCount = 0;
            _resourceReleaser = new ResourceReleaserImpl <SoftwareBitmap>(
                b =>
            {
                b.Dispose();
                ++_releaseCallCount;
            });

            _closeableStaticBitmap = new CloseableStaticBitmap(
                _bitmap, _resourceReleaser, ImmutableQualityInfo.FULL_QUALITY, 0);
        }
コード例 #3
0
            private CloseableReference <CloseableImage> PostprocessInternal(CloseableImage sourceImage)
            {
                CloseableStaticBitmap staticBitmap            = (CloseableStaticBitmap)sourceImage;
                SoftwareBitmap        sourceBitmap            = staticBitmap.UnderlyingBitmap;
                CloseableReference <SoftwareBitmap> bitmapRef =
                    _postprocessor.Process(
                        sourceBitmap,
                        _parent._bitmapFactory,
                        _parent._flexByteArrayPool);

                int rotationAngle = staticBitmap.RotationAngle;

                try
                {
                    return(CloseableReference <CloseableImage> .of(
                               new CloseableStaticBitmap(bitmapRef, sourceImage.QualityInfo, rotationAngle)));
                }
                finally
                {
                    CloseableReference <SoftwareBitmap> .CloseSafely(bitmapRef);
                }
            }