Example #1
0
        void ReleaseDesignerOutlets()
        {
            if (FirstImage != null)
            {
                FirstImage.Dispose();
                FirstImage = null;
            }

            if (SecondImage != null)
            {
                SecondImage.Dispose();
                SecondImage = null;
            }

            if (TestCaptureButton != null)
            {
                TestCaptureButton.Dispose();
                TestCaptureButton = null;
            }

            if (TrackingMessage != null)
            {
                TrackingMessage.Dispose();
                TrackingMessage = null;
            }

            if (FirstActivityIndicator != null)
            {
                FirstActivityIndicator.Dispose();
                FirstActivityIndicator = null;
            }

            if (SecondActivityIndicator != null)
            {
                SecondActivityIndicator.Dispose();
                SecondActivityIndicator = null;
            }
        }
Example #2
0
        private async void ApplyExecute()
        {
            if (FirstImage == null || SecondImage == null)
            {
                return;
            }

            if (_inProgress)
            {
                _queuedApply = true;
                return;
            }

            FilterApplied = false;
            _inProgress   = true;

            using (var firstStream = FirstImage.ToStream())
                using (var secondStream = SecondImage.ToStream())
                    using (var session = await EditingSessionFactory.CreateEditingSessionAsync(firstStream))
                        using (var blendingSession = await EditingSessionFactory.CreateEditingSessionAsync(secondStream))
                        {
                            session.AddFilter(FilterFactory.CreateBlendFilter(blendingSession, SelectedBlendFunction));
                            var wb = new WriteableBitmap(FirstImage.PixelWidth, FirstImage.PixelHeight);
                            await session.RenderToWriteableBitmapAsync(wb);

                            BlendedImage = wb;
                        }

            _inProgress   = false;
            FilterApplied = true;
            if (_queuedApply)
            {
                _queuedApply = false;
                ApplyExecute();
            }
        }
Example #3
0
 public bool MatchPair(Pair pair)
 {
     return(FirstImage.Equals(pair.FirstImage) && SecondImage.Equals(pair.SecondImage));
 }