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

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

Frage

    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

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top