如何在TAnimate中使用自定义AVI?

Mic*_*ick 0 delphi delphi-2010

我有一个AVI文件,我使用Resources Extract从shell32中提取.我想在TAnimate中使用它,但我无法弄清楚如何加载这个文件.

我使用DelphiDabbler的rcdatacreator程序成功地将AVI加载到.RES文件中(您必须下载"工作示例"才能获得rcdatacreator.但是,我现在的问题是弄清楚如何从.RES中提取AVI文件并将其提供给TAnimate.

我正在使用Delphi 2010:

在此输入图像描述

任何帮助表示赞赏.

Ken*_*ite 9

正如Andreas所提到的(在他现在删除的答案中),您不需要使用外部工具在最新版本的Delphi中添加资源.

使用Project/Resources and Images...IDE菜单.通过浏览到.AVI文件所在的文件夹,为其命名,然后键入AVI资源类型来添加新资源.(它不在列表中,但您可以添加它.)

Delphi资源编辑器

在运行时,使用以下代码:

// I used CoolAVI as the resource name in my image above,
// so that's the name I need to use here.
Animate1.ResName := 'COOLAVI';
Animate1.Active := True;
Run Code Online (Sandbox Code Playgroud)