Method returns GDI error. - Windows Vista
- VS2005
- fileName = "C:\\Temp\\Tela.jgp"
// Método para salvar screen em arquivo
private 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)