使用 Office 2007 扩展(即 docx)作为基于皮肤的屏幕键盘
我正在为我的应用程序创建一个屏幕键盘,它也支持皮肤。 这是我对皮肤所做的事情,我有一个文件夹,其中包含一些图像和一个将图像映射到键盘的 xml 文件,我希望能够将该文件夹作为 zip 文件,就像 Office 2007 中的那样 (.docx )和iPhone固件(.ipsw),我知道我可以简单地压缩文件夹并更改扩展名,我需要知道的是如何读取代码中的文件。
I'm creating a On-Screen keyboard for my application, and it supports skins as well.
Here's what I'm doing with the skins, I have a folder which contains some images and a xml file which maps the images to the keyboard, I want to be able to have the folder as a zip file like in Office 2007 (.docx) and iPhone firmwares (.ipsw), I know I can simply zip the folder and change the extension, what I need to know is how to read the files in the code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您有两个选择,要么 1) 仅使用 zip 库,例如 SharpZipLib 或 < a href="http://dotnetzip.codeplex.com/" rel="nofollow noreferrer">DotNetZip 或 2) 尝试使用 System.IO.Packaging 命名空间。我认为选项 1 可能是最简单的。
Office 和其他程序所做的事情并没有什么神奇之处,它们只是读取 zip 文件并根据需要从中提取内容。您只需从 MemoryStream 中提取图像,而不是从磁盘中提取图像。
You've got two options, either 1) just use a zip library like SharpZipLib or DotNetZip or 2) try to use the System.IO.Packaging namespace. I think option 1 would be the easiest probably.
There's nothing really magical that Office and other programs are doing, they're just reading a zip file and pulling stuff out of it as needed. Instead of pulling an image from a disk you just pull it from a MemoryStream.