hey
using the given code, the empty plot clones itself with no error message. to create the waveformPlotTimeHistory i simply called:
waveformGraph.PlotYMultiple(plotBuffer, DataOrientation.DataInRows, xMin, plotIncrement);
i have set up the first plot for the graph as waveformPlotTimeHistory. occasionally there are more than one plot, hence plot y multiple, but usually not.
any ideas why cloning this would cause an error?
the exact error message is:
System.ArgumentException was unhandled
Message="Destination array was not long enough. Check destIndex and length, and the array's lower bounds."
Source="mscorlib"
ParamName=""
StackTrace:
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Array.CopyTo(Array array, Int32 index)
at NationalInstruments.UI.Internal.ce.b(a8 A_0)
at NationalInstruments.UI.Internal.a8.a(ControlElement A_0)
at NationalInstruments.UI.Internal.ay.a(ControlElement A_0)
at NationalInstruments.UI.WaveformPlot.Clone()
at SubAnalysis.MainForm.SaveTimeHistoryToPNG() in C:\Documents and Settings\Dikkie\My Documents\Visual Studio 2005\Projects\SubAnalysis\SubAnalysis\MainForm.cs:line 366
at SubAnalysis.MainForm.saveAsPNG_Click(Object sender, EventArgs e) in C:\Documents and Settings\Dikkie\My Documents\Visual Studio 2005\Projects\SubAnalysis\SubAnalysis\MainForm.cs:line 455
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at SubAnalysis.Program.Main() in C:\Documents and Settings\Dikkie\My Documents\Visual Studio 2005\Projects\SubAnalysis\SubAnalysis\Program.cs:line 17
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()