wmz文件是什么?
WMZ是被用作Windows媒体播放器的界面自定义皮肤的压缩文件扩展名。自定义皮肤是负责更改Windows媒体播放器的外观。它包含一些图形与定义程序中的每个元件的功能的JavaScript代码。
通过将word转换成html,或者复制图片时在剪切板上都可以看到后缀为wmz的文件。
如何转换wmz文件?
第一种方式:
转换为JPG/GIF/PNG/等
using (GZipStream gzipStream = new GZipStream(File.OpenRead(imagePath), CompressionMode.Decompress)){Image image = Image.FromStream(gzipStream);image.Save(exportUrl, ImageFormat.Png);}
第二种方式:
转换为WMF文件
MemoryStream decompressStream = new MemoryStream(File.ReadAllBytes(imagePath));GZipStream gzipStream = new GZipStream(decompressStream, CompressionMode.Decompress);MemoryStream outStream = new MemoryStream();int readCount;byte[] data = new byte[2048];do{readCount = gzipStream.Read(data, 0, data.Length);outStream.Write(data, 0, readCount);} while (readCount == 2048);File.WriteAllBytes(exportUrl, outStream.GetBuffer());