0

I am completely confused. I've tried to use DecodePixelWidth property but get error: "The property 'DecodePixelWidth' was not found in type 'BitmapImage'" Then I've tried to compile simple program with code from MSDN page:

<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>

But this doesn't worked either. Googling gave me nothing. In C# I got same error.

Update. Using silverlight 4.0.

Seekeer
  • 1,344
  • 2
  • 18
  • 31

1 Answers1

2

The DecodePixelWidth and DecodePixelHeight properties are not available for Silverlight, as you can see in the MSDN Silverlight documentation for BitmapImage. PixelWidth and PixelHeight are available, but only as getter properties.

Anders Gustafsson
  • 15,837
  • 8
  • 56
  • 114
  • 1
    Thanks a lot! Its strange that I was able to find this property by pressing F1 on `` element while I was editing Silverlight app. – Seekeer Jul 11 '12 at 14:41