如何从 VB6 .frx 文件中提取图像? [英] How do I extract images from a VB6 .frx file?

查看:28
本文介绍了如何从 VB6 .frx 文件中提取图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一些 VB6 代码转换为 C#.VB6 将资源存储在 .frx 文件中,与 C# 将其存储在 .resx 文件中的方式相同.如何将 .frx 文件中的图像转换为可以嵌入到 .resx 文件中的图像?

I'm converting some VB6 code to C#. VB6 stores resources in a .frx file, the same way C# stores it in .resx files. How do I convert the images in a .frx file into something that can be embedded in a .resx file?

推荐答案

在 .frm 文件中,它包含这样的行:

In the .frm file, it contains lines like this:

    Image = "blah.frx" : 1234

字符串是文件(显然),数字是图像的十六进制偏移量.在该位置有一个 12 字节的标头,该标头的最后 4 个字节包含图像的长度(以字节为单位).图像本身紧跟在 12 字节的标头之后.

The string is the file (obviously), and the numbers are a hexadecimal offset to the image. There's a 12 byte header at that location, and the last 4 bytes of that header contain the length of the image in bytes. The image itself immediately follows the 12 byte header.

转换为 .resx 只是对该图像调用 Convert.ToBase64String().

Converting to a .resx is just calling Convert.ToBase64String() on that image.

这篇关于如何从 VB6 .frx 文件中提取图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆