"图像格式是无法识别"视显示器 [英] "The image format is unrecognized" depending on monitor

查看:272
本文介绍了"图像格式是无法识别"视显示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个C#WPF项目(.NET 4.0,Visual Studio 2010中)。它已经过测试在Windows XP和Windows 7和看起来工作正常,但现在我已经收到报告,从两个客户领域(均位于西班牙出于某种原因),谁也无法启动该软件。

We have a C# WPF project (.NET 4.0, Visual Studio 2010). It has been tested on both Windows XP and Windows 7 and seems to work fine, but now I have received reports from two customers on the field (both located in Spain for some reason) who cannot start the software.

查看日志文件,我看到他们得到的图像格式是无法识别异常(产生的原因:从HRESULT异常:0x88982F07)。

Looking at the log file I see that they get "The image format is unrecognized" exception (Caused by: Exception from HRESULT: 0x88982F07).

我用Google搜索上的错误,我发现,这似乎是WPF无法加载在Windows XP Vista的PNG图标。但是,这些报告有几个岁,想必微软现在解决它(?),在我的情况下,它工作正常在大多数XP安装。我真的不希望限制的图标出现在更近的Windows。

I have googled on the error and I have found that this seems to be that WPF fails to load the Vista PNG icon on Windows XP. But those reports are a couple of years old, surely Microsoft resolved it by now (?), and in my case it works fine on most XP installations. I really don't want to limit the icon appearance on more recent Windows.

最常见的使用我们的应用是笔记本电脑,而其中一个用户报告说,当他连他的笔记本电脑到外部显示器的问题得到了解决。而当我问另外一个测试同样的事情,他也有同样的结果。

The most common use of our application is on Laptops, and one of the users reported that when he connected his laptop to an external monitor the problem got resolved. And when I asked the other one to test the same thing he had the same result.

所以我的问题是:你知不知道这个问题已经解决了微软?你知道为什么它只发生在某些Windows XP的情况下,它是如何与显示器?最重要的是,你知道自己能做什么,使我们的应用程序更为健壮这种不改变图标?

So my questions are: Do you know if this problem has been resolved by Microsoft? Do you know why it only happens on some Windows XP instances and how it is related to the monitor? And most importantly, do you know what I could do to make our application more robust to this without changing the icon?

推荐答案

今天我同样的错误,出了蓝色,只有在我的机器。在WPF实施似乎仍然马车。

I had the same error today, out of the blue, and only on my development machine. The WPF implementation seems to be still buggy.

如果我理解这一点(文章)的权利,它可以发生在任何地方被读取ICO文件。在我的情况下,它是同时在XAML中设置一个图标的主应用程序窗口:

If I understand this (article) right, it can occur everywhere ICO files are read. In my case it was while setting an icon for the main application window in XAML:

<Window x:Class="MyApp.MainWindow"  Icon="Dashboard.ico" >

以上code失败突然,但使用的是PNG文件解决了这个问题:

The above code failed suddenly, but using a PNG file solved the problem:

<Window x:Class="MyApp.MainWindow"  Icon="Dashboard.png" >

这篇关于&QUOT;图像格式是无法识别&QUOT;视显示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆