我有一个表单"TForm1“有一个"TAnimate1”。我有一个AVI资源作为文件名"Animate 01.avi“,资源标识符为"AVI”,另一个"Animated Cursor“作为文件名"Cursor 01.ani”,资源标识符为"8“。
我希望在"FormCreate“事件上播放"Animate 01.avi”,并将默认光标设置为"8“。
我用的是"Delphi XE2“。
发布于 2011-12-16 04:56:05
要从资源加载TAnimate中的avi,必须使用ResHandle和ResId或ResName属性。
如果您有资源的id,请使用如下代码
Animate1.ResHandle:=HInstance;
Animate1.ResId :=2;//this is the id of the resource如果您有资源的名称
Animate1.ResHandle:=HInstance;
Animate1.Resame :='MyAvi';//this is the name of the resource要从资源装载游标,必须使用LoadCursor函数
Screen.Cursors[NIndex] := LoadCursor(HInstance, '8');//or if you are using a number instead an string LoadCursor(HInstance, MAKEINTRESOURCE(8))https://stackoverflow.com/questions/8524652
复制相似问题