简体   繁体   English

'为'System.Windows.Baml2006.TypeConverterMarkupExtension'提供价值,引发了一个异常。 行号'49'和行位置'38'

[英]'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '49' and line position '38'

I am making my first wpf application which now just implements a "floor" with a texture, viewed from above. 我正在制作我的第一个wpf应用程序,它现在只是实现了一个带有纹理的“地板”,从上面看。 when running I get this exception: 在运行时我得到这个例外:

Provide value on System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' 在System.Windows.Baml2006.TypeConverterMarkupExtension'上提供了一个异常'。 Line number '49' and line position '38' 行号'49'和行位置'38'

The line they talk about is 他们谈论的界限是

<ImageBrush ImageSource="/wood1_1000X1000.jpg" />.

I also tried with a png extension. 我也试过png扩展。 The image has a resolution of 1000 x 1000. 图像的分辨率为1000 x 1000。

Assuming the image is: 假设图像是:

  • Included in your project 包含在您的项目中
  • It's in a folder named "Images" 它位于名为“Images”的文件夹中
  • The build action for the image is set to "Resource" (should be the default) 图像的构建操作设置为“资源”(应该是默认值)

You can reference it like this: 你可以像这样引用它:

<ImageBrush ImageSource=
   "pack://application:,,,/YourProjectName;component/Images/wood1_1000X1000.jpg";

In my case, I had foreground color as 282828 for a checkbox. 就我而言,我的前景色为复选框282828。 I changed it as #282828. 我改为#282828。 Its fixed the issue. 它解决了这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 System.Windows.Baml2006.TypeConverterMarkupExtension&#39;抛出异常。&#39; 行号&#39;6&#39;和行位置&#39;10 - System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10 在“ System.Windows.Baml2006.TypeConverterMarkupExtension”上提供值引发异常 - Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception '在 'System.Windows.Baml2006.TypeConverterMarkupExtension' 上提供值引发异常。 - 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' System.Windows.Baml2006.TypeConverterMarkupExtension - System.Windows.Baml2006.TypeConverterMarkupExtension 如何解决此错误:“在&#39;System.Windows.Baml2006.TypeConverterMarkupExtension&#39;上提供值” - How do I fix this error : 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' 使用触发器更改图像获取System.Windows.Baml2006.TypeConverterMarkupExtension错误 - Change an image using triggers getting System.Windows.Baml2006.TypeConverterMarkupExtension error "Xaml 异常:“在 &#39;System.Windows.Markup.StaticResourceHolder&#39; 上提供值引发异常。”" - Xaml exception: "Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception." 错误System.Windows.Baml2006.TypeConverterMerkupExtension。 会是什么呢? - error System.Windows.Baml2006.TypeConverterMerkupExtension. What could it be? WPF&#39;设置属性&#39;System.Windows.ResourceDictionary.DeferrableContent&#39;引发了一个异常。 - WPF 'Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.' WPF 应用程序错误“设置属性“System.Windows.ResourceDictionary.Source”引发异常。 - WPF application error 'Set property 'System.Windows.ResourceDictionary.Source' threw an exception.'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM