How to take a screenshot of a WPF control?
问题 I created a WPF application using the Bing maps WPF control. I would like to be able to screenshot only the Bing maps control. Is use this code to make the screenshot: // Store the size of the map control int Width = (int)MyMap.RenderSize.Width; int Height = (int)MyMap.RenderSize.Height; System.Windows.Point relativePoint = MyMap.TransformToAncestor(Application.Current.MainWindow).Transform(new System.Windows.Point(0, 0)); int X = (int)relativePoint.X; int Y = (int)relativePoint.Y; Bitmap