Parameter Is Not Valid when changing filters

I seem to intermittently run into the following error when using SGP. Typically (but not always) it happens when I select the “Filters” tab of the Control Panel…sometimes as I change a filter, sometimes not. At least once, it’s simply cropped up while adjusting things in the sequencer, not touching filters or anything of the sort.

The exception text is quite lengthy. I’ll be happy to post it here if desired, or email it somewhere to avoid cluttering the forum.

When this error occurs, I can click “Continue”, and SGP will function normally, but all the Filter images in control panel become a big red square with an X in it.

Since SGP continues to function fine, it’s not really a huge issue, so much as a minor head-scratcher at times.

Sorry i can’t give more detailed steps to reproduce the problem, but it seems terribly intermittent.

A few questions:

  1. What operating system are you using?
  2. Have you tried to re-install the .NET 4.0 framework?
  3. What does your filter wheel setup look like (i.e. what filters are in what position on the form)?

From the exception stack in you screenshot, the fact that System.Drawing is throwing the exceptions can be a a bad thing, but I think it might be related to trying to show the filter picture in the CP when you have some (or no) filter selected.

  1. Win 7 64 Bit
  2. I have not. I’ll give that a try tomorrow.
  3. This has happened with 2 different FW. Each was/is a 5pos wheel, with filters 1-5 being Lum, Red, Green, Blue, Ha, in that order.

Current filter is a Starlite Xpress mini USB FW w/ OAG. Previous was a DIY arduino mod of an Orion Manual 5pos for which i wrote the ASCOM driver. I have, frankly, presumed it was a bug in my driver somewhere until it began happening with this new FW as well.

Hrm…I haven’t made specific note of this, but i DO believe you may be on to something here…best my memory can recall, this has typically happened with the filter selection dropdown being blank/empty…no filter selected…as it is when first starting things up.

I’ll re-install .NET 4.0 per your suggestion, and then make careful observation of the selected filter (or lack of) when/if it happens again.


Ken, I will jump in here with a “me too” post. I get the same error and as the OP says very intermittently and I can continue with the session. I also use Windows 7 64bit with a SX filter wheel, with 5 positions. I can’t say when or why this happens, but I will try and keep a note next time. I have all the filter positions filled and named. installed is 4.5.1, should I download 4.5.2 and install that?


FWIW, the complete Exception Text follows. (There’s more detail of loaded assemblies and the like, but this is the full exception text) :

************** Exception Text **************
System.ArgumentException: Parameter is not valid.
   at System.Drawing.Image.get_Width()
   at System.Drawing.Image.get_Size()
   at System.Windows.Forms.PictureBox.ImageRectangleFromSizeMode(PictureBoxSizeMode mode)
   at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.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)

While I can’t be sure (because I cannot reproduce this issue), I have made some changes that will hopefully prevent this issue from occurring (made in SGPro 2.4). Because this bug is non-crashing it will not be placed into a 2.3 maintenance release.

Reinstalled .NET 4.5 yesterday as suggested, and the problem did not come up last night during an all night session that included 2 different restarts of SGP (due to other issues, not SGP)…so, while not dispositive, it’s encouraging.

Sounds like a winner, Ken…and makes perfect sense not to rush a patch for it, since, as you say, it’s non-crashing.

Thanks for your help and attention to this…I’ll continue updating as things happen (or don’t).

So this is, as it turns out, happening again, but now I know of at least one way to reproduce it on demand.

  • Start SGP
  • Open Control Panel Click “Filters” tab.
  • Change to any different filter than the one currently in use.
  • Drag the control panel off the screen so the filter image is no longer visible.
  • Drag control panel back fully on screen
  • Drag control panel off screen again.
  • Drag control panel back on screen, error will occur.

Windows 7 64 bit
.NET Framework 4 (reinstalled today)

Let me say first that I have no idea have you came across that series of steps (but thank you for reporting it)… This has been fixed and will be out in a future beta (soon). For now I would recommend using the filter module instead of the CP if this is causing you issues.

LOL Ya know, as I was typing that whole thing out, I was thinking “Man…nobody’s gonna BELIEVE I stumbled across this.”

I’d had a hunch the last few times that it kinda seemed tied to whether the filter image was visible, but I couldn’t really pin it down. Yesterday, somewhere during prep for a session, I moved the control panel out of the way to see something, and when i drug it back…bam. So…I spent a few minutes trying to duplicate it, and finally stumbled on that set of steps. :smile:

Awesome! Thanks for the quick response, and hard work. It’s really not a huge issue…SGP still works fine if you just click continue…but it’ll be nice not to sweat it any more.

Thanks again!

If you ever need a job just let me know. You can go to work on my bug testing team anytime! :smiley:

Talking of obscure UI bugs seeing this reminded me, pull the image history window and right click on any of the empty lines, an exception is thrown

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at SequenceGenerator.ImageHistoryTextDisplay.c(Object A_0, MouseEventArgs A_1)
at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
at System.Windows.Forms.ListView.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 **************

You are overlooking the fact that the reason I can FIND weird bugs is because I WRITE so many of them in my own code. :smiley:

LOL. Got it.