3

我需要构建一个图像管理器,它允许用户构建照片/图像的集合,然后为他们提供将这些照片转换为单个 EXE 的选项,该 EXE 在运行时会将目标 PC 上的照片/图像显示为全屏幻灯片放映。

是否可以对多个图像执行此操作?

4

4 回答 4

5

Should be possible. What you'll have to do is a EXE framework (stub) that reads its own binary and checks for an appended image list (can be something simple like [number of images][image sizes][image_1]...[image_n]) and displays those in a slide show.

You can then concatenate the EXE stub, the image information and the images for your final slide show EXE.

Searching for the end of the EXE file (beginning of the image list) is usually done by using a constant header that does not appear in the EXE file, knowing the size of the stub EXE or writing the image list offset at the end of the EXE file. Alternatively, you can store the information the other way round and start reading from the end of the file.

Here is something that looks like a good link for stub example code.

于 2010-07-16T07:06:49.920 回答
2

IrfanView 已经可以做到这一点:
http
://www.irfanview.com/ 它甚至可以再次从 exe 文件中解压它们。

于 2010-07-16T12:18:40.677 回答
0

您可以构建一个应用程序来枚举自己的资源并加载它们以进行显示;最终用户将运行此幻灯片放映。一个单独的应用程序可以将用户选择的资源添加到第一个资源中。有关添加资源的信息,请参阅UpdateResource的 MSDN 文档,有关枚举它们的信息,请参阅EnumResourceNames

于 2010-07-16T13:09:45.050 回答
0

我们提供了一些免费和开源类来读取捆绑(或不捆绑)到 exe 的 .zip 存档。因此,您可以将任何 .zip 存档附加到您的 exe,然后使用一个类提取此 .zip 中的任何图片。

使用以下方法:

constructor TZipRead.Create(const aFileName: TFileName; ZipStartOffset, Size: cardinal);

并提供 paramstr(0) - 即您的 exe - 作为 aFileName 和 ZipStartOffset 作为最小的原始 exe 大小:它将从该偏移量搜索 .zip 文件的开头。将 Size 参数保留为 0:它将从文件大小本身获取大小。

如果您愿意,同一个类可以将任何 .zip 存档作为资源嵌入到您的 exe 中。

它们是将 .zip 内容附加到 exe 的两种方式:

  1. 使用复制 /b original.exe+pictures.zip newembedded.exe
  2. 使用提供的 TZipWrite 类及其 AddFromZip() 方法从 Delphi 代码创建您的 exe:您甚至可以即时压缩和附加您的图像,而无需临时的 pictures.zip 文件。

http://synopse.info/forum/viewtopic.php?pid=163

于 2010-07-17T10:01:14.647 回答