資源簡介
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?????????????{
????????????????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\desc
?????文件??????????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-reba
?????文件?????????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\ob
?????目錄???????????0??2018-03-27?22:01??12?Game1.0\.git\ob
?????文件????????8648??2017-10-29?01:08??12?Game1.0\.git\ob
............此處省略520個文件信息
- 上一篇:WPF 自動更新
- 下一篇:C#基于AE空間分析源碼
評論
共有 條評論