WPF媒体IndexOutOfRangeException [英] WPF Media IndexOutOfRangeException
问题描述
我收到了以下异常.它是随机发生的,但是会杀死我的WPF应用程序.大家知道原因是什么,也许是解决办法?
高兴,
Sonny
System.IndexOutOfRangeException:索引超出了数组的范围.
在System.Windows.Media.MatrixStack.Push(矩阵与矩阵,布尔值合并)
在System.Windows.Media.CompositionTarget.MarkVisibleRealizationsForTransform(RealizationContext rc,Matrix& transform)在系统.Windows.Media.CompositionTarget.MarkVisibleRealizations(RealizationContext rc)
在System.Windows.Media.MediaContext.Render(ICompositionTarget resizedCompositionTarget)
在System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
在System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)上的/>
在System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback,Object args,Boolean isSingleParameter)
在System.Windows.Threading上.ExceptionWrapper.TryCatchWhen(对象源,System.Windows.Threading.Dispatcher.WrappedInvoke(委派回调,对象args,布尔isSingleParameter,委托catchHandler)的Delegate回调,对象args,布尔isSingleParameter,Delegate catchHandler)
在System.Windows.Threading .DispatcherOperation.InvokeImpl()
在System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(对象状态)
在System.Threading.ExecutionContext.runTryCode(对象userData)在System.Runtime.CompilerServices .RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码,CleanupCode backoutCode,对象userData)
在System.Threading.ExecutionContext.RunInternal(ExecutionContext执行上下文,ContextCallback回调,对象状态)
在System.Threading.ExecutionContext.Run(ExecutionContext) executionContext,ContextCallback回调,对象状态)
在System.Windows.Threading.DispatcherOperation.Invoke()
在System.Windows.Threading.Dispatcher.ProcessQueue()
在System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean&在MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean&已处理)
在MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
在System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate回调,对象args,布尔值isSingleParameter)
在System.Windows.Threading.ExceptionWrapper.TryCatchWhen(对象源,委托回调,对象args,布尔值isSingleParameter,委托catchHandler )
在System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调,对象args,布尔isSingleParameter,委托catchHandler)
在System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority优先级,TimeSpan超时,委托System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority优先级,Delegate方法,对象arg)的方法,对象args,布尔值isSingleParameter)
在MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd,Int32 msg ,IntPtr wParam,IntPtr lParam)
在MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
在System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
在System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
在System.Windows.Threading.Dispatcher .Run()
在System.Windows.Application.RunDispatcher(对象忽略)
在System.Windows.Application.RunInternal(窗口窗口)
在System.Windows.Application.Run(Window window)
在SolidGold.Huddle.Client.HuddleScope.HuddleScope.Main(String [] args)
Hi,
I'm getting the following exception. It happens quite randomly but it kills my WPF application. Do you folks know what the cause and maybe the fix for this?
cheers,
Sonny
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Windows.Media.MatrixStack.Push(Matrix& matrix, Boolean combine)
at System.Windows.Media.CompositionTarget.MarkVisibleRealizationsForTransform(RealizationContext rc, Matrix& transform)
at System.Windows.Media.CompositionTarget.MarkVisibleRealizations(RealizationContext rc)
at System.Windows.Media.MediaContext.Render(ICompositionTarget resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at SolidGold.Huddle.Client.HuddleScope.HuddleScope.Main(String[] args)
推荐答案
您好,Sonny Soriano,
没有任何代码,很难说出导致异常的原因.
您是否按索引访问数组条目?
Hi Sonny Soriano,
without any code its hard to say what cause the exception.
Do you access Array entries by index?
这篇关于WPF媒体IndexOutOfRangeException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!