I want to save an image from my WPF user control. It works but I got black bars on the right side and the bottom. If I change the dpiX (96) and dpiY (96) it works but when I maximize the window, it's wrong again (then a bit of the usercontrol is missing ).
This is how I save the image as bitmap:
Dim parentWindow As Window = Window.GetWindow(_Map)
Dim rtb As New RenderTargetBitmap(parentWindow.ActualWidth, parentWindow.ActualHeight, 96, 96, PixelFormats.Pbgra32)
rtb.Render(_Map)
Dim ms As New MemoryStream()
Dim bp As New BmpBitmapEncoder()
bp.Frames.Add(BitmapFrame.Create(rtb))
bp.Save(ms)
Dim saveMap As New Bitmap(ms)
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)