如何将JPEG图像转换为Blob? [英] How to convert the JPEG image to blob?
本文介绍了如何将JPEG图像转换为Blob?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将JPEG图像转换为blob?
解决方案
您的图像(物理文件已经是blob)...您可以将其导入内存RAM中
FileStram imgStream = File.OpenRead("C:\\photos\me.jpg"); byte[] blob = new byte[imgStream.Length]; imgStream.Read( blob, 0, (int)imgStream.Length); imgStream.Dispose( );
现在blob
数组包含您图片的二进制视图...
一个jpeg编码的图像就是一个BLOB,几乎其他任何东西.
>
How to convert the JPEG image to blob?
解决方案
your image (physical file is already a blob)...you can import this in the memory RAM
FileStram imgStream = File.OpenRead("C:\\photos\me.jpg"); byte[] blob = new byte[imgStream.Length]; imgStream.Read( blob, 0, (int)imgStream.Length); imgStream.Dispose( );
Nowblob
array contains the binary view of your picture...
A jpeg encoded image is a BLOB, as is almost anything else.
这篇关于如何将JPEG图像转换为Blob?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文