![](/img/trans.png)
[英]Using WIC to reproduce WPF BitmapImage.DecodePixelWidth / Height
[英]BitmapImage.DecodePixelWidth property disappered
我完全糊涂了。 我试图使用DecodePixelWidth属性但得到错误:“在'BitmapImage'类型中找不到属性'DecodePixelWidth'”然后我尝试使用MSDN页面中的代码编译简单程序:
<Grid x:Name="LayoutRoot">
<Image Width="200">
<Image.Source>
<BitmapImage DecodePixelWidth="200" UriSource="C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water Lilies.jpg" />
</Image.Source>
</Image>
</Grid>
但这也不起作用。 谷歌搜索没有给我什么。 在C#中我得到了同样的错误。
更新。 使用silverlight 4.0。
DecodePixelWidth
和DecodePixelHeight
属性不适用于Silverlight,您可以在MSDN Silverlight文档中看到BitmapImage 。 PixelWidth
和PixelHeight
可用,但仅作为getter属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.