Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey,
i have a form where i added a background image when i try running the exe found in bin\debug on another PC i get this error i pasted below, when i remove the picture from the form everything runs smoothly ... any suggestions ?



MSIL
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentException: Parameter is not valid.
   at System.Drawing.Image.get_FrameDimensionsList()
   at System.Drawing.ImageAnimator.CanAnimate(Image image)
   at System.Drawing.ImageAnimator.ImageInfo..ctor(Image image)
   at System.Drawing.ImageAnimator.Animate(Image image, EventHandler onFrameChangedHandler)
   at System.Windows.Forms.PictureBox.Animate(Boolean animate)
   at System.Windows.Forms.PictureBox.Animate()
   at System.Windows.Forms.PictureBox.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.Control.OnParentVisibleChanged(EventArgs e)
   at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3603 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Testing
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file://rnd-development/SCAS%20Releases/test/Testing.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Posted
Comments
Sandeep Mewara 25-Oct-10 4:02am    
Can you check EventViewer for more information. Current log can be because of various reasons.

1 solution

That is thrown because one of the arguments thrown to a method is not a valid argument.

Hard to see without your code, the error message is fairly generic otherwise.

But I suspect that you are throwing in an image that has not been recognised by the method.

Please show your code portion that is failing.
 
Share this answer
 
Comments
SuperAdministrator 25-Oct-10 4:19am    
The code is not failing when its local, but its throwing this exception when on another PC , i followed it to here
this.pictureBox1.Image = global::Testing.Properties.Resources.cards1;
this.pictureBox1.Location = new System.Drawing.Point (12,155);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size (605,199);
this.pictureBox1.TabIndex = 4;
this.pictureBox1.TabStop = false;
SuperAdministrator 25-Oct-10 7:03am    
private void control_Paint(object sender, PaintEventArgs e) {
try
{
Image logo = Resources.Picture;
e.Graphics.DrawImage(logo, (Width - logo.Width)/2, (Height - logo.Height)/2);//this produces the exception
}
catch (Exception ex)
{
HandleException(ex);
}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900