动画游标播放 [英] Animated Cursor Playing

查看:125
本文介绍了动画游标播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有一个 TAnimate1的 TForm1表单。我有一个带有资源标识符 AVI的AVI资源作为文件名 Animate 01.avi,还有一个带有资源标识符 8的动画光标作为文件名 Cursor 01.ani。我希望播放 Animate 01。 FormCreate事件上的 avi,并将默认光标设置为 8。我正在使用 Delphi XE2。

I have a Form "TForm1" having one "TAnimate1". I have one AVI Resource as File Name "Animate 01.avi" with Resource Identifier "AVI" and one "Animated Cursor" as File Name "Cursor 01.ani" with Resource Identifier "8".I wish to play "Animate 01.avi" on "FormCreate" event and set default cursor as "8". I'm using "Delphi XE2".

请从 http://hotfile.com/dl/137675080/34f701f/KoushikHalder01.7z.html下载我的项目文件

Please download my project file from "http://hotfile.com/dl/137675080/34f701f/KoushikHalder01.7z.html" and tell where to rectify.

推荐答案

好,已下载...

首先,将avi放在 RCDATA部分中。正如我已经说过的那样,这是行不通的。动画控件会加载AVI类型的avi文件。因此,这行

First, you're putting the avi in an 'RCDATA' section. As I've already said, that won't work. An animate control loads the avi file of an AVI type. So this line

AVI RCDATA "KoushikHalder.avi"

在您的。 rc文件,实际上应该是:

in your '.rc' file, should be in fact:

AVI AVI "KoushikHalder.avi"

您可以随便输入ID,但资源类型应为 AVI

You can put whatever you like for ID, but the resource type should be AVI.


其次,您将加载avi通过其资源标识符。您为其指定了 AVI标识符。因此,您的代码中的这一行:


Second, you would load the avi by its resource identifier. You've given an 'AVI' identifier for it. So this line in your code:

Animate01.ResName :='KoushikHalder.avi';

实际上应该是:

Animate01.ResName :='AVI';


第三,您的 .ani文件不符合标准。有关详情,请参见此问题。除非更正,否则您将无法加载该ani文件。


Third, your '.ani' file does not conform with the standards. See this question for details. You won't be able to load that ani file unless you correct it.


第四,您没有正确加载该ani文件。它的标识符不是'8',而是8。因此,以下行:


Fourth, you're not loading the ani file correctly. It's identifier is not '8', it's 8. So the below line:

Screen.Cursors[8] := LoadCursor(HInstance, '8');

应该是

Screen.Cursors[8] := LoadCursor(HInstance, MakeIntResource(8));

(或Pointer(8)..)。

(or Pointer(8)..).


最后,您必须将光标设置到ani文件的某个位置,以便可以看到它。例如:


Lastly, you have to set the cursor somewhere to your ani file so that you can see it. For instance:

Screen.Cursor := 8;

BitBtn01.Cursor := 8;



我希望这会有所帮助...



I hope this helps...

这篇关于动画游标播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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