Extending the list of supported image formats in GDI+

后端 未结 1 1453
逝去的感伤
逝去的感伤 2020-12-11 04:10

To quote the documentation for the System.Drawing.Imaging namespace

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

<
相关标签:
1条回答
  • 2020-12-11 04:49

    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.

    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
    

    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.

    0 讨论(0)
提交回复
热议问题