image WriteableBitmap image .Pixels The field, constructor or member 'Pixels' is not defined?

StackOverflow https://stackoverflow.com/questions/16073735

Domanda

    let image = WriteableBitmap(100, 100, 300.0, 300.0, Media.PixelFormats.Bgra32, null);
            let pixel = image.Pixels

Error 2 The field, constructor or member 'Pixels' is not defined

WriteableBitmap.Pixels Property MSDN

Why not defined?

Is this a framework issue? or ... scope? or ?

Thanks

È stato utile?

Soluzione

Pixels is a property of the System.Windows.Media.Imaging.WriteableBitmap class for Silverlight, that is different than the System.Windows.Media.Imaging.WriteableBitmap class of the standard framework.

You should reference the Silverlight version of the framework to use the first class - and have the Pixels property - but then you will be writing a Silverlight application, not a standard Windows one.

To access the pixel values using the standard framework you can use the CopyPixels methods

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top