Create WPF element offscreen and render to bitmap
I can't understand why this doesn't work, or what I need to get it to work. To repro, create a simple WPF application and replace the main window's constructor thusly: public MainWindow() { InitializeComponent(); // simple visual definition var grid = new Grid { Width = 300, Height = 300 }; var text = new TextBlock { Text = "Y DON'T I WORK???", FontSize = 100, FontWeight = FontWeights.Bold }; grid.Children.Add(text); // update the layout so everything is awesome cool grid.Measure(grid.DesiredSize); grid.Arrange(new Rect(grid.DesiredSize)); grid.UpdateLayout(); // create a BitmapSource from the