예제 #1
0
        private void CreateThumbnailSurface()
        {
            const uint scaleFactor           = 8;
            var        rawPixelsPerViewPixel = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
            var        pageWidth             = Page.Width / rawPixelsPerViewPixel;
            var        pageHeight            = Page.Height / rawPixelsPerViewPixel;
            var        pageViewSize          = new Size(pageWidth / scaleFactor, pageHeight / scaleFactor);

            _thumbnailSis = new SisPageRenderer(Page, pageViewSize);

            var thumbnailBackgroundBrush = new ImageBrush
            {
                ImageSource = _thumbnailSis.Source
            };

            thumbnailContentCanvas.Background = thumbnailBackgroundBrush;
        }
예제 #2
0
        private void CleanUp()
        {
            if (_pageViewObserver != null)
            {
                _pageViewObserver.ZoomFactorChanging -= HandleZoomFactorChanging;
                _pageViewObserver.ZoomFactorChanged  -= HandleZoomFactorChanged;
                _pageViewObserver = null;
            }

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

            _thumbnailSis = null;
            thumbnailContentCanvas.Background = null;
            contentCanvas.Background          = null;
            contentCanvas.Children.Clear();
            Page      = null;
            TextLayer = null;
        }