public void UpdateImageSize() { viewPort.Resize((int)ViewPortImage.ActualWidth, (int)ViewPortImage.ActualHeight); ViewPortImage.Source = viewPort.WriteableBmp; scene.UpdateBitmap(viewPort.WriteableBmp); }