• 大小: 3.14MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-12
  • 语言: C#
  • 标签: C#  C-S  你画我猜  

资源简介

https://github.com/VictorYXL/You-draw-and-I-guess 基于C#的局域网内你画我猜小游戏 包含客户端与服务器

资源截图

代码片段和文件信息

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 AForge;
using AForge.Video;
using AForge.Video.DirectShow;
using AForge.Imaging;
using AForge.Imaging.Filters;

namespace Client
{
    public partial class Camera : Form
    {
        VideoCaptureDevice camera;
        Panel mp;
        FilterInfoCollection videoDevices;
        public Camera(Panel mp)
        {
            this.mp = mp;
            this.Disposed += Camera_Disposed;
            InitializeComponent();
            this.FormBorderstyle = FormBorderstyle.FixedSingle;
            videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            for (int i = 0; i < videoDevices.Count; i++)
            {
                String videoName = videoDevices[i].Name;
                if (videoName.Substring(0 5) != “Corel“)
                    cmb_Camrea.Items.Add(videoName);
                else {
                    videoDevices.RemoveAt(i);
                    i--;
                }
                camera = null;
            }

        }

        void Camera_Disposed(object sender EventArgs e)
        {
            videoPlayer.SignalToStop();
            videoPlayer.WaitForStop();
        }

        private void cmb_Camrea_SelectedIndexChanged(object sender EventArgs e)
        {
            camera = new VideoCaptureDevice(videoDevices[cmb_Camrea.SelectedIndex].MonikerString);
            camera.DesiredframeSize = new Size(540400);
            camera.DesiredframeRate = 1;
            this.videoPlayer.VideoSource = camera;
            this.videoPlayer.Start();
        }

        private void btn_Cancel_Click(object sender EventArgs e)
        {
            videoPlayer.SignalToStop();
            videoPlayer.WaitForStop();
            this.Dispose();
        }

        private void btn_Grap_Click(object sender EventArgs e)
        {
            Bitmap img = new Bitmap(740 400);
            videoPlayer.DrawToBitmap(imgnew Rectangle(1000videoPlayer.WidthvideoPlayer.Height));
            mp.DrawCamera(img);
            videoPlayer.SignalToStop();
            videoPlayer.WaitForStop();
            this.Dispose();

        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-03-27 22:01  12 Game1.0\
     目录           0  2018-03-27 22:01  12 Game1.0\.git\
     文件          34  2017-10-29 01:08  12 Game1.0\.git\COMMIT_EDITMSG
     文件         250  2017-10-29 01:08  12 Game1.0\.git\config
     文件          73  2017-10-29 01:07  12 Game1.0\.git\description
     文件          23  2017-10-29 01:07  12 Game1.0\.git\HEAD
     目录           0  2018-03-27 22:01  12 Game1.0\.git\hooks\
     文件         478  2017-10-29 01:07  12 Game1.0\.git\hooks\applypatch-msg.sample
     文件         896  2017-10-29 01:07  12 Game1.0\.git\hooks\commit-msg.sample
     文件         189  2017-10-29 01:07  12 Game1.0\.git\hooks\post-update.sample
     文件         424  2017-10-29 01:07  12 Game1.0\.git\hooks\pre-applypatch.sample
     文件        1642  2017-10-29 01:07  12 Game1.0\.git\hooks\pre-commit.sample
     文件        1348  2017-10-29 01:07  12 Game1.0\.git\hooks\pre-push.sample
     文件        4951  2017-10-29 01:07  12 Game1.0\.git\hooks\pre-rebase.sample
     文件         544  2017-10-29 01:07  12 Game1.0\.git\hooks\pre-receive.sample
     文件        1239  2017-10-29 01:07  12 Game1.0\.git\hooks\prepare-commit-msg.sample
     文件        3610  2017-10-29 01:07  12 Game1.0\.git\hooks\update.sample
     文件       23081  2017-10-29 01:08  12 Game1.0\.git\index
     目录           0  2018-03-27 22:01  12 Game1.0\.git\info\
     文件         240  2017-10-29 01:07  12 Game1.0\.git\info\exclude
     目录           0  2018-03-27 22:01  12 Game1.0\.git\logs\
     文件         179  2017-10-29 01:08  12 Game1.0\.git\logs\HEAD
     目录           0  2018-03-27 22:01  12 Game1.0\.git\logs\refs\
     目录           0  2018-03-27 22:01  12 Game1.0\.git\logs\refs\heads\
     文件         179  2017-10-29 01:08  12 Game1.0\.git\logs\refs\heads\master
     目录           0  2018-03-27 22:01  12 Game1.0\.git\logs\refs\remotes\
     目录           0  2018-03-27 22:01  12 Game1.0\.git\logs\refs\remotes\origin\
     文件         142  2017-10-29 01:09  12 Game1.0\.git\logs\refs\remotes\origin\master
     目录           0  2018-03-27 22:01  12 Game1.0\.git\objects\
     目录           0  2018-03-27 22:01  12 Game1.0\.git\objects\00\
     文件        8648  2017-10-29 01:08  12 Game1.0\.git\objects\00\107afa8d93778847f13924d355a4ec4cef9071
............此处省略520个文件信息

评论

共有 条评论