Can't find System.Windows.Media namespace?

后端 未结 4 1909
有刺的猬
有刺的猬 2020-11-28 09:20

I\'m using an object from a 3rd party API that has a property of type System.Windows.Media.ImageSource, yet I can\'t seem to find the System.Windows.Media names

相关标签:
4条回答
  • 2020-11-28 10:07

    You should add reference to PresentationCore.dll.

    0 讨论(0)
  • 2020-11-28 10:08

    The System.Windows.Media.Imaging namespace is part of PresentationCore.dll (if you are using Visual Studio 2008 then the WPF application template will automatically add this reference). Note that this namespace is not a direct wrapping of the WIC library, although a large proportion of the more common uses are still available and it is relatively obvious how these map to the WIC versions. For more information on the classes in this namespace check out

    http://msdn2.microsoft.com/en-us/library/system.windows.media.imaging.aspx

    0 讨论(0)
  • 2020-11-28 10:17

    Add PresentationCore.dll to your references. This dll url in my pc - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\PresentationCore.dll

    0 讨论(0)
  • 2020-11-28 10:25

    For Visual Studio 2017

    Find "References" in Solution explorer

    Right click "References"

    Choose "Add Reference..."

    Find "Presentation.Core" list and check checkbox

    Click OK

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