C# 如何使用c将file.DEX(Dexis图像文件)转换为jpg图像格式#
我写了一个程序,它可以读取.Dex文件(Dexis X-ray图像文件)并将其转换为jpg图像。但我不知道怎么破译它。 我使用此代码读取和转换,但图像已损坏 读取图像:C# 如何使用c将file.DEX(Dexis图像文件)转换为jpg图像格式#,c#,image,image-processing,C#,Image,Image Processing,我写了一个程序,它可以读取.Dex文件(Dexis X-ray图像文件)并将其转换为jpg图像。但我不知道怎么破译它。 我使用此代码读取和转换,但图像已损坏 读取图像: public static byte[] ImageToByte(string IMG_PATH) { byte[] img = null; try { FileStream IM_STREAM = new FileStream(IMG_PATH,
public static byte[] ImageToByte(string IMG_PATH)
{
byte[] img = null;
try
{
FileStream IM_STREAM = new FileStream(IMG_PATH, FileMode.Open, FileAccess.Read);
BinaryReader IM_BNR = new BinaryReader(IM_STREAM);
img = IM_BNR.ReadBytes((int)IM_STREAM.Length);
IM_BNR.Close();
IM_STREAM.Close();
}
catch (Exception ex)
{
StreamWriter swr = new StreamWriter("LOG.txt", true, Encoding.UTF8);
swr.WriteLine(ex.Message);
swr.Close();
}
return img;
}
public static void SaveToFile(string path, byte[] b)
{
MemoryStream ms = new MemoryStream(b);
Image img = Image.FromStream(ms);
img.Save(path + "\\exam.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
img.Dispose();
}
转换图像:
public static byte[] ImageToByte(string IMG_PATH)
{
byte[] img = null;
try
{
FileStream IM_STREAM = new FileStream(IMG_PATH, FileMode.Open, FileAccess.Read);
BinaryReader IM_BNR = new BinaryReader(IM_STREAM);
img = IM_BNR.ReadBytes((int)IM_STREAM.Length);
IM_BNR.Close();
IM_STREAM.Close();
}
catch (Exception ex)
{
StreamWriter swr = new StreamWriter("LOG.txt", true, Encoding.UTF8);
swr.WriteLine(ex.Message);
swr.Close();
}
return img;
}
public static void SaveToFile(string path, byte[] b)
{
MemoryStream ms = new MemoryStream(b);
Image img = Image.FromStream(ms);
img.Save(path + "\\exam.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
img.Dispose();
}
转换前的图像(.Dex,尺寸800x600px)->转换后的图像(.jpg,尺寸80x60)。请帮助我。.dex是一种半专有格式。使用标准的图像解码库,您看到的结果是最好的。如果您正在寻找付费解决方案,我知道有一个团队目前正在为此开发web服务API,但尚未公开发布。如果您有兴趣成为早期测试人员,我可以与您联系。您需要知道.dex文件的格式,并根据文件规范编写解码函数。你有关于文件格式的信息吗?谢谢你的回答,我没有关于它的任何信息,所以我把这个问题贴在这里。这里不是询问这类事情的地方。你可能会很幸运,知道的人可能会看到这篇文章,但不要指望它。你最好联系一些编写文件的供应商,假设格式不是专有的,或者在一些更合适的论坛上查询。我很感兴趣,你能分享到这个服务的链接吗?