【问题标题】:Silverlight : Implementing ImagesSilverlight:实施图像
【发布时间】:2010-10-08 08:01:05
【问题描述】:

我刚刚在 Microsoft Blend 中创建了一个由显示虚拟图像(即白框)的图像框组成的木偶。在混合中它显示图像,但在 Visual Studio 中(以及在运行应用程序时)图像没有显示。

这是我正在使用的代码的 sn-p

<Image Source="/Images/BodyParts/dummy.jpg" Height="10" Width="20" Stretch="Fill" OpacityMask="{x:Null}" x:Name="backFoot" Canvas.Left="41.71" Canvas.Top="147.668" />

alt text http://img26.imageshack.us/img26/1401/blendvscomparewo7.jpg

请注意,您在两个版本中看到的圆圈是不同的控件,而不是图像。

【问题讨论】:

    标签: wpf silverlight image controls


    【解决方案1】:

    确保您的图片 "dummy.jpg" 出现在解决方案资源管理器中的正确文件夹中

    例子:

    Solution Explorer http://img403.imageshack.us/img403/4976/solutiontm2.jpg

    如果您在图像上右键单击 -> 属性,您应该会看到 “属性” 窗口。

    然后将“Build Action”设置为“Content”,如下图:

    Properties http://img338.imageshack.us/img338/9166/propertiesfl9.jpg

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-30
      • 2014-08-13
      • 1970-01-01
      相关资源
      最近更新 更多