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

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top