在扩展GDI支持的图像格式列表+ [英] Extending the list of supported image formats in GDI+

查看:177
本文介绍了在扩展GDI支持的图像格式列表+的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要引用文档系统.Drawing.Imaging命名空间

恩codeR类使用户扩展GDI +支持的任何图像格式。

The Encoder class enables users to extend GDI+ to support any image format.

但我找不到任何文档,示例或其他任何解释如何我会去实现自己的自定义文件格式 - 大多数搜索返回大量的信息传递恩coderParameters,但没有对实现我们自己的恩codeRS?

Yet I can find no documentation, examples or anything else that explains how I'd go about implementing my own custom file format -- most searches return lots of information on passing EncoderParameters, but nothing on implementing our own Encoders?

在理想情况下,我很乐意能在C#来实现这一点,但我ppared重温我的ATL如果需要的话$ P $:)

Ideally, I'd love to be able to implement this in C#, but I am prepared to dust off my ATL if needs be :)

有没有人碰到的任何文件或能够提供关于如何处理这个任何指针?

Has anyone come across any documentation or are able to provide any pointers on how to approach this?

更新:
我也许应该提及我到目前为止已经试过的东西,没有用:

Update:
I should probably mention the things I've tried so far, to no avail:

  • 寻找该的GUID在的图片codecInfo 类,看它是否是一个正常的COM接口(但它似乎没有定),其意图是看执行的接口,或者看它是否只是一个注册表项。
  • 在跨进 Image.FromFile 方法发现它只是一个包装的gdiplus.dll
  • 大量的谷歌搜索,这似乎提供大量利用现有的病例与指定自己的ImageEn coderParamerters;和人实施自己 codeCS通过其他方式
  • 甚至要求在<一个href="http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.win32.programmer.gdi&tid=a302c363-3891-4e2d-bbbf-c02b2de12fd2&cat=en_US_da48b8fe-0981-4869-b053-0c3a6b27a0a5&lang=en&cr=US&sloc=&p=1"相对=nofollow>新闻://microsoft.public.win32.programmer.gdi
  • Looking for the GUIDs returned in the ImageCodecInfo class to see if it was a normal COM interface (but it doesn't appear to be), the intention being to look at the implemented interfaces, or see if it's just a registry entry.
  • Stepped into Image.FromFile method to find it's just a wrapper for gdiplus.dll
  • Lots of Google searches, which seem to provide lots of cases of using the existing ones with specifying your own ImageEncoderParamerters; and a few cases of people implementing their own codecs by other means.
  • Even asked in news://microsoft.public.win32.programmer.gdi

推荐答案

好了,这里的一些信息,我设法挖。看来,推荐的(微软)的方式做你想要的是的开发一个WIC-启用codeC 为您的格式。 Windows图像处理组件(WIC)API自带了Vista,但也可用于XP和Win Server 2003中,无论是在.NET 3或单独下载。

Okay, here's some info I managed to dig up. It seems that the recommended (by Microsoft) way to do what you want is to develop a WIC-enabled codec for your format. The Windows Imaging Component (WIC) API comes built into Vista, but is also available for XP and Win Server 2003, either within .NET 3 or as a separate download.

然而,似乎也存在另一种方式来扩展GDI + $ C $抄送列表,但这些水是很多迷雾。如果你在一个十六进制编辑器打开的gdiplus.dll,你会发现一个参考下面的注册表项:

However, there also seems to exist another way to extend GDI+ codec list, but those waters are a lot murkier. If you open gdiplus.dll in a hex editor, you'll find a reference to the following registry key:

Software\Microsoft\Imaging\Codecs

谷歌搜索该关键字会送你到 MSDN文章的有关注册自己的形象codeCS在Windows CE和Windows Mobile平台的会谈。有趣的是,在XP的Gdiplus.dll有说的注册表​​项硬codeD在里面。我没有检查它是否使用它,虽然我还没有尝试过开发自己的codeC,无论是WIC或GDI +。

Googling for that key will send you to an MSDN article that talks about registering your own image codecs on Windows CE and Windows Mobile platforms. The funny thing is that the gdiplus.dll on XP has the said registry key hardcoded in it. I haven't checked whether it uses it, though and I haven't tried developing my own codec, either for WIC or for GDI+.

我希望这个信息帮助,至少让你开始。

I hope this info helps at least get you started.

这篇关于在扩展GDI支持的图像格式列表+的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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