如何将RAW数据转换为JPEG文件? [英] How to covert RAW data into JPEG file ?
本文介绍了如何将RAW数据转换为JPEG文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我使用的库返回包含RAW数据的byte [],即所有
像素;在没有标题的字节数组中编码的颜色值。我想将这些数据保存到JPEG文件中。
如何通过c#代码将这些原始数据转换为jpeg文件。
谢谢和问候
Shweta
Hello,
I am using a library which returns a byte[] containing RAW data, ie all
pixels; color values coded in a byte array without header. I would like to
save those data into a JPEG file.
How to convert this raw data into jpeg file through c# code.
Thanks & Regards
Shweta
推荐答案
一个想法
原始字节 - > ;流 - >位图 - >保存到JPEG文件
One idea
Raw bytes -> Stream -> Bitmap -> Save to JPEG file
MemoryStream stream = new MemoryStream();
stream.Write(rawdata);
Bitmap bm = new Bitmap(stream);
bm.Save("C:\example.jpg", System.Drawing.Imaging.ImageFormat.JPEG);
没有常见的原始格式!所有这些原始格式都是特定于供应商的。您必须使用该供应商的SDK。在那里你应该找到处理图像的方法。
There is no such thing as a common raw format! All those "raw formats" are vendor-specific. You have to use the SDK of that vendor. There you ought to find methods for handling the image.
我认为如果没有外部库你就无法做到,正如解决方案2所示。但看看这个,也许可以帮助 imagemagick
I think you can't do it without an external library,as Solution 2 indicates. But have a look at this,maybe could help imagemagick
这篇关于如何将RAW数据转换为JPEG文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文