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