How to display an AVI file full screen

zhaozj2021-02-11  258

(1) Create a project file

(2) Select File | New Form to create a form and set its name: = Form2

(3) Set Form2.Borderstyle: = BSNONE

(4) Place a MedialPlayer component on Form2

(5) Place a PANEL component on Form2, set its name: = Panel1

(6) Set panel1.align: = alclient

(7) Add the following code added to the button1 of Form1:

Procedure TFORM1.BUTTON1CLICK (Sender: TOBJECT);

Begin

WITH FORM2 DO

Begin

WindowsTate: = WSMAXIMIZED;

Mediaplayer1.notify: = false;

MediaPlayer1.display: = panel1;

MediaPlayer1.FileName: = 'c: /temp/cool.avi';

Mediaplayer1.open;

Mediaplayer1.displayRect: = form2.clientRect;

Mediaplayer1.play;

END;

END;

(8) Add the following code to the ONNOTIFY event of Form2 MediaPlayer1

Procedure TFORM2.MEDIAPLAYER1NOTIFY (Sender: TOBJECT);

Begin

if MediaPlayer1.notifyValue = NVsuccessful

THEN FORM2.CLOSE;

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

New Post(0)