FormatConvertedBitmap - 发现错误,没有适合完成此操作的成像组件
我正在使用下面的代码将 RGB tif 文件转换为 CMYK 格式。它在我的本地开发计算机(Windows 7)上运行良好,但在我们的 Windows 2003 生产服务器中抛出此错误。
错误: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [NotSupportedException:找不到适合完成此操作的成像组件。] System.Windows.Media.Imaging.FormatConvertedBitmap.FinalizeCreation() +376 System.Windows.Media.Imaging.FormatConvertedBitmap.EndInit() +158 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
下面是我正在使用的代码: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FormatConvertedBitmap newFormatedBitmapSource = new FormatConvertedBitmap(); newFormatedBitmapSource.BeginInit(); newFormatedBitmapSource.Source = myBitmapSource; newFormatedBitmapSource.DestinationFormat = PixelFormats.Cmyk32; newFormatedBitmapSource.EndInit(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
我做了一些研究,有些人建议检查 WindowsCodecs.dll 版本。 我这样做了,发现我的开发机器中的版本是 6.1.7600,而服务器版本是 6.0.5840。我尝试将较新的版本复制到服务器中并通过 regsvr32 注册,但我收到“找不到入口点 dllregisterserver”。我尝试搜索 windowsCodecs 6.1 安装程序,但找不到任何安装程序。
如何更新服务器中的WindowsCodecs.dll?我正在为这个问题找到正确的解决方案吗?任何意见将不胜感激。
谢谢
I'm using code below for converting an RGB tif file to CMYK format. It works great on my local development machine(Windows 7) but is throwing this error in our Windows 2003 production server.
Error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[NotSupportedException: No imaging component suitable to complete this operation was found.]
System.Windows.Media.Imaging.FormatConvertedBitmap.FinalizeCreation() +376
System.Windows.Media.Imaging.FormatConvertedBitmap.EndInit() +158
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Below is the code I'm using:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FormatConvertedBitmap newFormatedBitmapSource = new FormatConvertedBitmap();
newFormatedBitmapSource.BeginInit();
newFormatedBitmapSource.Source = myBitmapSource;
newFormatedBitmapSource.DestinationFormat = PixelFormats.Cmyk32;
newFormatedBitmapSource.EndInit();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I've done some research and some people suggested to check the WindowsCodecs.dll version.
I did that and found out in my dev machine the version is 6.1.7600 while the server version is 6.0.5840. I tried copying the newer version into the server and registering via regsvr32 but I'm getting "entry point dllregisterserver not found". I tried searching the windowsCodecs 6.1 installer but cannot find any.
How can I update WindowsCodecs.dll in the server? Am I heading in the right solution to this issue? Any input will be greatly appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
另一种可能的解决方案是:
如果您的客户端运行的是 Windows XP,并且您在 WPF 窗口中使用图标。 Windows 标题栏中会显示一个图标。删除该图标以及程序窗口中的任何图标,可能可以解决该错误。
不止一次地在这个问题上花了几个小时,而且它总是与窗口中的图标有关。注意:其他图像可以在程序内使用,但不能在窗口标题中使用 .ico。
Another possible resolution is:
If your client is running Windows XP and you are using an icon in your WPF window. There is an icon that shows up in the windows title bar. Remove that icon and any icons in your program windows and it may resolve the error.
Spent hours on this one more than once, and it always had to do with an Icon in the window. Note: other images will work inside the program but not an .ico in the Window Title.
结果服务器有一些问题(文件损坏)并且需要重建。
Turned out the server has some issues (file corruption) and needs to be rebuild.