I need to develop a screen capture program that runs on Mac OS X Lion. I tried to make a screenshot using mono and GTK#, but the screenshot is black
Gdk.Window window = Gdk.Global.DefaultRootWindow;
if (window!=null)
{
Gdk.Pixbuf pixBuf = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, false, 8,
window.Screen.Width, window.Screen.Height);
pixBuf.GetFromDrawable(window, Gdk.Colormap.System, 0, 0, 0, 0,
window.Screen.Width, window.Screen.Height);
pixBuf.ScaleSimple(400, 300, Gdk.InterpType.Bilinear);
pixBuf.Save("screenshot0.jpeg", "jpeg");
}
Can you point me in right direction. Preferably using mono, but if will be java, c++ or objective c is also good.
Thank in advance.
For Java, see Robot.createScreenCapture(Rectangle). Note though, that
Robotcommonly also produces a black screen image for apps. that take direct control of the screen area (e.g. many games).