How to take screenshot from Panel in mono C#?
How to take all screensh开发者_JS百科ot from Panel in mono C# ? I need not used winAPI.
My panel can not be fully visible.
Your question is not exactly clear but in case you meant taking a screenshot of the desktop: below is a small example of how you could do this using gtk:
using Gtk;
...
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");
}
hope this helps, regards
精彩评论