小编Cos*_*lea的帖子

C#DirectX视频无法播放

我想制作一个C#Windows Forms应用程序,该应用程序显示一支笔,当您单击它时它会变成一个菠萝,当您单击该菠萝时会变成一个苹果,然后变成笔,单击时会启动一个音乐视频。对我来说不起作用的是视频,我不想因为不喜欢而将其显示在Windows Media Player中。这是代码:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.DirectX.DirectSound;
using Microsoft.DirectX.AudioVideoPlayback;
using Microsoft.DirectX;

namespace Picture_Button
{
    public partial class Form1 : Form
    {
        Video video = new Video("C:\\Users\\Pushkin\\Desktop\\PPAP.mp4");
        private int clicks = 0;
        public Form1()
        {
            InitializeComponent();
            video.Owner = this;
            pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {
            clicks++;
        }

        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            switch (clicks)
            {
                case 0: …
Run Code Online (Sandbox Code Playgroud)

c# directx

3
推荐指数
1
解决办法
1566
查看次数

标签 统计

c# ×1

directx ×1