怎样得到一个文件的后缀名?

zouwenyan 2002-06-04 03:01:02
怎样得到一文件的后缀名,顺便问下:
(1)怎样改变一个文件的存放路径?
(2)在delphi中怎样预览一个flash文件?
很急的,下周就要交了,先感谢万分!
...全文
423 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
9527 2002-06-04
  • 打赏
  • 举报
回复
在Delphi里播放Flash动画

http://www.sina.com.cn 2001/09/26 11:29 赛迪网-中国计算机报

  文/姚佩云
  在Flash大行其道的今天,是否想过在你的程序里也加入几幅Flash动画炫一炫呢?OK,心动不如行动,让我们现在就开始吧!
  首先,你的机器里要装有Flash播放软件(你的IE能显示Flash)。IE之所以能显示Flash是安装了由Macromedia公司提供的sw#{3tech.sina.com.cn/introduction/focus/flash.shtml target=_blank>flash3}#.ocx控件,我们可以在Win98的SystemMacromed Flash中或在W




in2000中的System32 MacromedFlash中找到它。ActiveX控件在Windows里是通用的,Delphi也同样支持。
  运行Delphi后,选择选单Component→Import ActiveX Control,找到SWFlash.OCX 文件进行安装。安装完成后,ActiveX面板里出现TShockwaveFlash控件,这是Delphi对SWFlash.OCX的封装,现在我们就可以用这个控件来播放Flash了。拖一个Flash过来,放在Form上,指定其Movie属性为d: est.SWF,并按F9键加以运行即可。怎么样,运行效果不错吧?下面,笔者将具体介绍TShockwaveFlash主要属性、方法和事件,以便于读者开发。
  TShockwaveFlash主要属性如下:
  ReadyState:读一个flash文件时的状态,其中包括0=Loading、1=Uninitialized、2=Loaded、3=Interactive和4=Complete;
  TotalFrames:总帧数,只有当ReadyState = 4时才能访问该属性;
  FrameNum:当前播放的帧;
  Playing:播放或暂停一个flash;
  Quality:指定当前渲染的质量,包括0=Low, 1=High、2=AutoLow、3=AutoHigh;
  ScaleMode:缩放模式,0=ShowAll、1= NoBorder、2 = ExactFit;
  AlignMode:对齐模式,Left=+1、Right=+2、Top=+4、Bottom=+8;
  BackgroundColor:背景色,-1为默认颜色;
  Loop:是否循环;
  Movie:指定播放的flash文件路径,可以为一个URL。
  TShockwaveFlash主要方法如下:
  Play():开始播放动画;
  Stop();停止播放动画;
  Back();播放前一帧动画;
  Forward():播放后一帧动画;
  Rewind():播放第一帧动画;
  SetZoomRect(int left, int top, int right, int bottom):设置缩放的区域;
  Zoom(int percent):按百分比缩放;
  Pan(int x, int y, int mode):缩放播放面板,其中模式0为按像数、1为按窗口百分比。
  TShockwaveFlash主要事件如下:
  OnProgress(int percent):读取一个flash时触发;
  OnReadyStateChange(int state):状态改变时触发。states的值可以为0=Loading、1=Uninitialized、2=Loaded、3=Interactive和4=Complete。
  更加详细的帮助请参见网页www.macromedia.com/support/flash/。
outer2000 2002-06-04
  • 打赏
  • 举报
回复
有现成的控件播放FLASH,只要导入SHOCKWAVE
outer2000 2002-06-04
  • 打赏
  • 举报
回复
function ExtractFileExt(const FileName: string): string;

Description

Use ExtractFileExt to obtain the extension from a file name. For example, the following code returns the extension of the file name specified by a variable named MyFileName:

MyFilesExtension := ExtractFileExt(MyFileName);

The resulting string includes the period character that separates the name and extension parts. This string is empty if the given file name has no extension.

Note: This function works for multi-byte character systems (MBCS).

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧