如何将位图图像转换为字节数组 [英] how can convert bitmapimage to byte array

查看:101
本文介绍了如何将位图图像转换为字节数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 如何在WPF中将bitmapimage转换为字节数组?
请帮帮我
thanx

解决方案

基本上,将其保存在内存流中,并将其读回为字节数组.

请参阅 http://msdn.microsoft.com/en-us/library/system. io.memorystream.aspx [ ^ ].

阅读之前,请不要忘记使用方法Seek返回零流位置.

使用方法Read进行阅读,请参见 http://msdn.microsoft.com /en-us/library/system.io.memorystream.read.aspx [ 解决方案

Basically, save it in a memory stream and read it back as an array of bytes.

Please see
http://msdn.microsoft.com/en-us/library/system.io.memorystream.aspx[^].

Before reading, don''t forget to get back to the zero stream position using the method Seek.

Read with the method Read, see http://msdn.microsoft.com/en-us/library/system.io.memorystream.read.aspx[^].

—SA


这篇关于如何将位图图像转换为字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆