private async Task LoadOutputVirtualBitmap() { if (OutputVirtualBitmap != null) { OutputVirtualBitmap.Dispose(); OutputVirtualBitmap = null; } //LoadedImageInfo = ""; OutputVirtualBitmap = await CanvasVirtualBitmap.LoadAsync(OutputImageCanvas.Device, OutputImageStream, CanvasVirtualBitmapOptions.None); if (OutputImageCanvas == null) { // This can happen if the page is unloaded while LoadAsync is running return; } ImageResolution.Text = InputVirtualBitmap.Bounds.Width + " x " + InputVirtualBitmap.Bounds.Height + " | " + OutputVirtualBitmap.Bounds.Width + " x " + OutputVirtualBitmap.Bounds.Height; var size = OutputVirtualBitmap.Size; OutputImageCanvas.Width = size.Width * (Zoom + 1); OutputImageCanvas.Height = size.Height * (Zoom + 1); OutputImageCanvas.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 OutputCanvasScrollViewer_ViewChanging(object sender, ScrollViewerViewChangingEventArgs e) => OutputImageCanvas.Invalidate();