|
Animation control help
The animation control allows you to play an AVI file in an area in your window.
Function help:
Real API_Animation_Create (Real Parent Handle, Real X, Real Y, Real Width, Real Height, Real Style Flags, Real Extended Style Flags);
This function creates a new animation control.
Argument list:
(0) Parent Handle: Identifies the window handle of the window to create this control on.
(1) X: The horizontal position of the control in pixels, relative to the parent window.
(2) Y: The vertical position of the control in pixels, relative to the parent window.
(3) Width: The horizontal size of the control in pixels.
(4) Height: The vertical size of the control in pixels.
(5) Style Flags: The style flags, supports the Global Control Styles and the following styles:
ACS_AUTOPLAY
Starts playback when the AVI file is opened.
ACS_CENTER
Centers the animation in the animation control.
ACS_TRANSPARENT
This function makes the background color the same as the parent's background color.
Style flags can be separated by a bitwise or '|' operator.
(6) Extended Style Flags: This can be any combination of the Global Extended Control Styles.
Return value:
If this function succeeds, it returns the Control ID of the control, otherwise it returns 0.
Real API_Animation_Close ( Real Control ID )
This function closes the currently opened AVI file.
Argument list:
(0) Control ID, the Control ID returned by API_Animation_Create.
Return value:
This function always returns 0 (false).
Real API_Animation_Open ( Real Control ID, String File name )
This function opens an AVI file for playback in the animation control.
The AVI file to open can only contain video, not audio, otherwise it fails.
Argument list:
(0) Control ID, the Control ID, returned by API_Animation_Create.
(1) File name, the file name of the AVI to open.
Return value:
Returns 1 (true) when succeeded, or 0 (false) otherwise.
Real API_Animation_Play ( Real Control ID, Real Start frame, Real End frame, Real Replay times )
This function starts the playback of the currently opened AVI file.
Argument list:
(0) Control ID, the Control ID, returned by API_Animation_Create.
(1) Start frame, the frame number to start the animation with. (must be less than 65536) (0 = the first frame)
(2) End frame, the last frame number in the animation. ( must be less than 65536) (-1 = last frame)
(3) Replay times, use -1 to replay forever.
Return value:
Returns 1 (true) when succeeded, or 0 (false) otherwise.
Real API_Animation_Seek ( Real Control ID, Real Frame number )
This function changes the currently displayed frame.
Argument list:
(0) Control ID, the Control ID, returned by API_Animation_Create.
(1) Frame number, the frame number to seek to. ( must be less than 65536)
Return value:
Returns 1 (true) when succeeded, or 0 (false) otherwise.
Real API_Animation_Stop ( Real Control ID )
This function stops the playback of the current AVI file.
Argument list:
(0) Control ID, the Control ID, returned by API_Animation_Create.
Return value:
Returns 1 (true) when succeeded, or 0 (false) otherwise.
Example code:
Animation1 = API_Animation_Create (Win, 5,5,100,20,ACS_AUTOPLAY|ACS_TRANSPARENT,0);
if ( API_Animation_Open (Animation1, "clip.avi") )
show_message ("The AVI file is opened and playback will start.");
else
show_message ("The AVI file cannot be opened."); |
Return to help index
|
|
|
|