Play flash in Delphi

zhaozj2021-02-08  196

Delphi playing Flash today, today, have you ever thought about adding several Flash dazzles in your program? Let's try, the premise is that you have Flash Play Software (your IE can display flash), IE can display Flash is installed with a swflash.ocx control, provided by Macromedia, Inc., we also use it Win98 is under $ Windows / System / Macromed / Flash, Win2k under $ Winnt / System32 / Macromed / Flash. The ActiveX control is common in Windows. Delphi is of course support, open your Delphi, we started. Select Menu Component -> Import ActiveX Control, select SWFLASH.OCX file, installation, after completion of the TshockWaveFlash control in the ActiveX panel, this is the package of Delphi to swflash.ocx, now we can use this control to play Flash. Drag one over the FORM, specify its MOVIE attribute to d: /test.swf, press F9, all OK. Delphi programming is so easy.

TshockWaveFlash main properties, methods, event properties:

ReadyState - The status when reading a Flash file. 0 = loading, 1 = uninitialized, 2 = loaded, 3 = interactive, 4 = Complete.

TotalFrames - The total frame number is only available when ReadyState = 4 is accessible.

Framenum - the currently played frame.

Playing - Play or suspend a flash.

Quality - Specifies the quality of the current rendering, 0 = low, 1 = high, 2 = AutoLow, 3 = AutoHigh

Scalemode - Zoom Mode, 0 = Showll, 1 = NoBorder, 2 = ExactFit.

AlignMode - Align mode, Left = 1, Right = 2, TOP = 4, Bottom = 8.

BackgroundColor - Background Color, Red * 65536 Green * 256 Blue, -1 is the default color.

LOOP - whether it is loop.

Movie - Specifies the Flash file path of the play, can be a URL.

Method: Play () - Start playing animation.

STOP () - Stop playing animation.

Back () - Plays the previous frame animation.

Forward () - Play a frame of animation.

ReWind () - Play the first frame animation.

SetzoomRect (int LEFT, INT TOP, INT Right, Int Bottom) - Set zoomed area

ZOOM (int Percent) - Zoom according to percentage.

PAN (int X, int y, int mode) - Zoom the play panel. Model is: 0- According to the image, 1 - percentage by window

Event: OnProgress - Triggered when reading a flash.

OnReadyStateChange (int State) triggered when the status changes. States can be 0 = load, 1 = uninitialized, 2 = loaded, 3 = interactive, 4 = Complete.

转载请注明原文地址:https://www.9cbs.com/read-2811.html

New Post(0)