1
A
回答
2
如果你有一个的BitmapSource可以使用BitmapSource.CopyPixels Method (Array, Int32, Int32)
或者alternativeley,例如,如果你需要一个ARGB字节序列:
var bmp = new WriteableBitmap((BitmapSource)source);
byte[] pixels = bmp.Pixels.SelectMany(p => new byte[]
{
(byte)p,
(byte)(p >> 8),
(byte)(p >> 16),
(byte)(p >> 24)
}).ToArray();
相关问题
- 1. 如何将ImageSource转换为byte []并返回ImageSource?
- 2. 如何将光标转换为ImageSource
- 3. 如何将ID2D1Bitmap转换为ImageSource
- 4. 如何将图像转换为ImageSource
- 5. 如何将Silverlight ImageSource转换为字节[]?
- 6. 如何将ImageSource转换为位图?
- 7. 将MessageBoxImage转换为ImageSource WPF
- 8. WPF:将ImageSource转换为Stream
- 9. 将位图转换为ImageSource
- 10. byte []到ImageSource流
- 11. 如何将int []转换为byte []
- 12. 如何将int转换为Byte数组?
- 13. 如何将byte []转换为PdfBitmap?
- 14. 如何将ref字节转换为byte []?
- 15. 如何将DSA私钥转换为byte []?
- 16. 如何将类型'byte []'转换为'System.Data.Linq.Binary'
- 17. 如何(快速)将float转换为Byte?
- 18. 如何将图像(BYTE *)转换为Base64
- 19. 如何将byte []转换为InputStream?
- 20. 如何将int转换为byte []?
- 21. 如何将byte []转换为varchar?
- 22. 如何将byte [100]转换为guid
- 23. 如何将HashSet转换为byte []?
- 24. C# - 将uint转换为byte []
- 25. 将byte []转换为UInt16。
- 26. 运行时将图标转换为ImageSource
- 27. WPF - 将位图转换为ImageSource
- 28. 将ImageSource转换成IRandomAccessStream
- 29. 如何将int转换为byte []并重新设置byte []的值
- 30. 如何将类型'system.linq.iqueryable <byte[]>'转换为'byte []'
的可能的复制[如何转换的ImageSource到字节数组?( https://stackoverflow.com/questions/26814426/how-to-convert-imagesource-to-byte-array) – 2017-11-09 02:29:09