none
WPF 不支持png?? RRS feed

  • 问题

  • 未处理 System.IO.FileFormatException
      Message=图像格式无法识别。
      Source=PresentationCore
      StackTrace:
           在 System.Windows.Media.PixelFormat.GetPixelFormat(SafeMILHandle bitmapSource)
           在 System.Windows.Media.Imaging.BitmapSource.UpdateCachedSettings()
           在 System.Windows.Media.Imaging.BitmapSource.set_WicSourceHandle(BitmapSourceSafeMILHandle value)
           在 System.Windows.Media.Imaging.BitmapFrameDecode.FinalizeCreation()
           在 System.Windows.Media.Imaging.BitmapSource.CompleteDelayedCreation()
           在 System.Windows.Media.Imaging.BitmapSource.get_PixelWidth()
           在 MS.Internal.AppModel.IconHelper.GetBestMatch(ReadOnlyCollection`1 frames, Int32 sysBitDepth, Int32 width, Int32 height)
           在 MS.Internal.AppModel.IconHelper.GetIconHandlesFromBitmapFrame(Object callingObj, BitmapFrame bf, IconHandle& largeIconHandle, IconHandle& smallIconHandle)
           在 System.Windows.Window.UpdateIcon()
           在 System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
           在 System.Windows.Window.CreateSourceWindowImpl()
           在 System.Windows.Window.SafeCreateWindow()
           在 System.Windows.Window.ShowHelper(Object booleanBox)
           在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
           在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           在 System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           在 System.Windows.Threading.DispatcherOperation.InvokeImpl()
           在 System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
           在 System.Threading.ExecutionContext.runTryCode(Object userData)
           在 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
           在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
           在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           在 System.Windows.Threading.DispatcherOperation.Invoke()
           在 System.Windows.Threading.Dispatcher.ProcessQueue()
           在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
           在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
           在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           在 System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           在 System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
           在 System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
           在 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(Object ignore)
           在 System.Windows.Application.RunInternal(Window window)
           在 System.Windows.Application.Run(Window window)
           在 System.Windows.Application.Run()
           在 LRCTranslatorLauncher.Application.Main() 位置 Z:\WpfApplication4\WpfApplication4\obj\x86\Debug\Application.g.vb:行号 74
           在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           在 System.Threading.ThreadHelper.ThreadStart()
      InnerException: System.Runtime.InteropServices.COMException
           Message=异常来自 HRESULT:0x88982F07
           ErrorCode=-2003292409
           InnerException: 

    在Windows XP出现的,Windows7没有错误!!

    2012年2月10日 10:58

答案

全部回复