private async Task LoadInputVirtualBitmap() { ContentFrame_Reset(); ContentFrameCollapse(); if (InputVirtualBitmap != null) { InputVirtualBitmap.Dispose(); InputVirtualBitmap = null; } //LoadedImageInfo = ""; InputVirtualBitmap = await CanvasVirtualBitmap.LoadAsync(InputImageCanvas.Device, InputImageStream, CanvasVirtualBitmapOptions.None); if (InputImageCanvas == null) { // This can happen if the page is unloaded while LoadAsync is running return; } var size = InputVirtualBitmap.Size; InputImageCanvas.Width = size.Width * (Zoom + 1); InputImageCanvas.Height = size.Height * (Zoom + 1); InputImageCanvas.Invalidate(); //LoadedImageInfo = string.Format("{0}x{1} image, is {2}CachedOnDemand", size.Width, size.Height, virtualBitmap.IsCachedOnDemand ? "" : "not "); }
private void Page_SizeChanged(object sender, SizeChangedEventArgs e) { InputImageCanvas.Invalidate(); OutputImageCanvas.Invalidate(); InputCanvasScrollViewer.MaxWidth = double.MaxValue; InputCanvasScrollViewer.MaxHeight = double.MaxValue; OutputCanvasScrollViewer.MaxWidth = double.MaxValue; OutputCanvasScrollViewer.MaxHeight = double.MaxValue; }
private void InputCanvasScrollViewer_ViewChanged(object sender, ScrollViewerViewChangedEventArgs e) { InputImageCanvas.Invalidate(); OutputCanvasScrollViewer.ChangeView(InputCanvasScrollViewer.HorizontalOffset, InputCanvasScrollViewer.VerticalOffset, null); }