scoubidou944
Messages postés714Date d'inscriptionmardi 22 avril 2003StatutMembreDernière intervention19 janvier 2017
-
7 déc. 2004 à 14:13
scoubidou944
Messages postés714Date d'inscriptionmardi 22 avril 2003StatutMembreDernière intervention19 janvier 2017
-
7 déc. 2004 à 17:19
J'ai beau chercher sur Gogole, je n'arrive pas à trouver ma vie complètement.
J'ai besoin d'ajouter un AVI dans un formulaire, par exemple à l'interieur d'un label ou d'une picturebox.
Si je ne spécifie pas le parent, la vidéo est jouée dans une fenetre independante. Si je le spécifie (mal ?) je n'ai aucun résultat.
Qql'1 aurait un sample court, clair, net & précis ?
[DllImport("winmm.dll")]private static extern long mciSendString(string strCommand, StringBuilder strReturn, int iReturnLength, IntPtr hwndCallback);
public void Open(string szFileName, Control _oObject)
{
//mpegvideo is the device type that we are going to use
//the format of the song location must be with double quotes around it
HandleRef hpictur = new HandleRef(_oObject, _oObject.Handle);
string szParent = _oObject.Handle.ToString ();
string szCommand = "open "" + szFileName + ""type mpegvideo alias MediaFile " + "parent" + szParent + " Style " + 0x40000000;
mciSendString(szCommand, null, 0, IntPtr.Zero);
}
public void Play (bool _bLoop)
{
//tell the device to play
string szCommand;
if (_bLoop)
szCommand = "play MediaFile repeat";
else
szCommand = "play MediaFile";
mciSendString(szCommand, null, 0, IntPtr.Zero);
}
----------------------------
C++ forever
C# amateur
cs_RMI
Messages postés305Date d'inscriptionvendredi 18 juillet 2003StatutMembreDernière intervention 2 août 20102 7 déc. 2004 à 16:27
Tu as 2 autres méthodes pour jouer un avi.
Soit avec Windows média player (que je te déconseille pour sa lourdeur) il existe un SDK (cf msdn)
Soit avec DirectX Managed ou il existe un objet Video ultra simple à mettre en place
video = new Video("mavideo.avi");
video.Ending += new System.EventHandler(this.VideoEnded);