I am running Windows Vista as well and have tested this on several machines without issue. You can see the attached screenshot that was created when I clicked the Button2 button on the form in the image. But here are some things to check:
Dê uma olha neste tópico do forum MSDN. Acho que será necessário um ajuste nesse recurso.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2459309&SiteID=1 Rogério Mauri
No idea about what can be wrong...
Just a thought, but have you tried isolating the problem... maybe hardcoding the fileName, like "C:\". Also, trying a different format, .Bmp maybe.
Also, you could try the formats on this post:
http://forum.strataframe.net/FindPost13029.aspx
Also, Google gdi ErrorCode=-2147467259 , there are some solutions over there, might be a threading thing.
- fileName = "C:\\Temp\\Tela.jgp"
- fileName = "C:\\Temp\\Tela.jpg" Rogério Mauri
- Windows Vista - VS2005 - fileName = "C:\\Temp\\Tela.jgp"
// Método para salvar screen em arquivoprivate void CapturaScreen(string fileName){ MicroFour.StrataFrame.Tools.ScreenCapture.CaptureScreenToFile(fileName, System.Drawing.Imaging.ImageFormat.Jpeg);}
System.Runtime.InteropServices.ExternalException was unhandled by user code Message="Erro genérico de GDI+." Source="System.Drawing" ErrorCode=-2147467259 StackTrace: em System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) em System.Drawing.Image.Save(String filename, ImageFormat format) em MicroFour.StrataFrame.Tools.ScreenCapture.CaptureScreenToFile(String FileName, ImageFormat Format) em NCClube.Forms.FormCracha.cmdFoto_Click(Object sender, EventArgs e) na C:\Users\Rogerio\Documents\Visual Studio 2005\Projects\StrataFrameProjects\NCClube\NCClube\Forms\FormCracha.cs:linha 111 em System.Windows.Forms.Control.OnClick(EventArgs e) em System.Windows.Forms.Button.OnClick(EventArgs e) em System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) em System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) em System.Windows.Forms.Control.WndProc(Message& m) em System.Windows.Forms.ButtonBase.WndProc(Message& m) em System.Windows.Forms.Button.WndProc(Message& m) em System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m) em System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m) em System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Rogério Mauri