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