The following method is taken from a WinForms app. It simply captures the screen, but I needed to modify it to work in a WPF application. When I use it, it returns a black image
I think the first two params to g.CopyFromScreen should be 0.
Here's code that works for me:
var size = System.Windows.Forms.Screen.PrimaryScreen.Bounds;
var capture = new System.Drawing.Bitmap(size.Width, size.Height);
var g = System.Drawing.Graphics.FromImage(capture);
g.CopyFromScreen(0, 0, 0, 0, new System.Drawing.Size(size.Width, size.Height));
g.Dispose();