.NET Picturebox problems under Windows 98

M

Mike

This problem only occurs on Windows 98 using Framework 1.1, when I try to
refresh a Picturebox I get the following exception:

(This does not happen all the time, code to refresh works fine on XP and
2000, could this be a bug in .NET?)

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentException: Invalid parameter used.
at System.Drawing.Image.get_FrameDimensionsList()
at System.Drawing.ImageAnimator.CanAnimate(Image image)
at System.Drawing.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.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
 
B

Bob Powell [MVP]

M

Mike Peretz

no, it is not an animated gif. It is a jpg file, a simple jpg file. However,
I used the desinger to set the image property so the image is included in
the exe file.
 
B

Bob Powell [MVP]

Hmm, this is odd then because the exception suggests that the failure comes
from the fact that the PictureBox is failing to extract the frame dimension
list which should be empty in the case of a JPEG..

Can you post us some code?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Check out February's edition of Well Formed.
Non-client drawing, Graphics Transform stack and Flood-Filling
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com
 
M

Mike Peretz

I did not code anything, all the code is generated by the designer. It is a
picture box with its Image property set to my jpg file (but it was medium
size jpg). I can see that the image is included in the resource file of the
form. I decided to modify my code and load the image at runtime from the
file. When I load the image from a file the problem do not occur. I am
almost sure this is a GDI bug with Windows 98.

I also found other weird stuff with 98. OleDb Provider for Jet 4.0, crashes
sometimes for no good reason (XP, 2000 no problems). Sometimes I also get an
error "Failed to load resources" when loading the application.

All these errors are intermittent, and don't happen all the time. We never
get these errors in 2000 or XP.

At the end, we decided not to support 98.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top