⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sf_flashreg.pas

📁 smartflash ,delphi vcl组件 ,可以实现透明flash窗体
💻 PAS
字号:
{*******************************************************************}
{                                                                   }
{       Almediadev Visual Component Library                         }
{       SmartFlash                                                  }
{       Version 1.50                                                }
{                                                                   }
{       Copyright (c) 2000-2007 Almediadev                          }
{       ALL RIGHTS RESERVED                                         }
{                                                                   }
{       Home:  http://www.almdev.com                                }
{       Support: support@almdev.com                                 }
{                                                                   }
{*******************************************************************}

unit sf_flashreg;

{$I sf_define.inc}
{$T-,W-,X+,P+}

interface

uses
  SysUtils, Dialogs, Forms, Classes, Controls,
  {$IFDEF AL_COMPILER6_UP} DesignIntf, DesignEditors {$ELSE} DsgnIntf {$ENDIF};

procedure Register;

implementation {===============================================================}

{$IFNDEF AL_COMPILER5_UP}
{$R *.dcr}
{$ENDIF}

uses sf_flashplayer, sf_Flash;

type

{ TsfFlashStreamProperty }

  TsfFlashStreamProperty = class(TPropertyEditor)
  private
  public
    procedure Edit; override;
    function GetAttributes: TPropertyAttributes; override;
    function GetValue: string; override;
  end;

procedure TsfFlashStreamProperty.Edit;
var
  OpenDialog: TOpenDialog;
begin
  { Execute editor }
  OpenDialog := TOpenDialog.Create(Application);
  OpenDialog.Filter := 'Flash file|*.swf|Flash video file|*.flv';
  try
    if OpenDialog.Execute then
    begin
      TsfFlashStream(GetComponent(0)).Flash.LoadFromFile(OpenDialog.FileName);
      if TsfFlashStream(GetComponent(0)).Flash.Size > 0 then
        TsfFlashStream(GetComponent(0)).FFlashStore := ExtractFileName(OpenDialog.FileName);
    end;
    Modified;
  finally
    OpenDialog.Free;
  end;
end;

function TsfFlashStreamProperty.GetAttributes: TPropertyAttributes;
begin
  Result := [paDialog];
end;

function TsfFlashStreamProperty.GetValue: string;
begin
  Result := TsfFlashStream(GetComponent(0)).DisplayName;
end;

{ Register classes ============================================================}

procedure Register;
begin
  RegisterComponents('SmartFlash', [TsfFlashPlayer, TsfFlashList,
                                    TsfLayeredFlashForm]);
  RegisterPropertyEditor(TypeInfo(string), TsfFlashStream, 'FlashStore', TsfFlashStreamProperty);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -