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. 如何将Silverlight ImageSource转换为字节[]?
- 5. 如何将图像转换为ImageSource
- 6. WPF:将ImageSource转换为Stream
- 7. byte []到ImageSource流
- 8. 如何将图像(BYTE *)转换为Base64
- 9. 如何将HashSet转换为byte []?
- 10. 如何将int转换为byte []?
- 11. 如何将byte [100]转换为guid
- 12. 如何将byte []转换为InputStream?
- 13. 如何将int []转换为byte []
- 14. 如何将byte []转换为varchar?
- 15. 如何将DSA私钥转换为byte []?
- 16. 如何将int转换为Byte数组?
- 17. 将byte []转换为UInt16。
- 18. C# - 将uint转换为byte []
- 19. WPF - 将位图转换为ImageSource
- 20. 如何将int转换为byte []并重新设置byte []的值
- 21. 如何将ImageSource转换为字节数组?
- 22. 如何将imagesource转换为字节[]或流在uwp?
- 23. 如何将此c#byte []转换为java byte [],然后将此数组转换为位图?
- 24. 在Java中,如何正确地将byte []转换为字符串为byte []?
- 25. 如何转换Newton.Json.Linq.JToken至byte []?
- 26. 将SDP数据从byte []转换为Object?
- 27. 无法将CString转换为BYTE数组
- 28. 将float []转换为byte []再次浮动[]
- 29. pdfbox将pdf转换为图像byte []
- 30. 将图像byte []转换为文件
的可能的复制[如何转换的ImageSource到字节数组?( https://stackoverflow.com/questions/26814426/how-to-convert-imagesource-to-byte-array) – 2017-11-09 02:29:09