1 private void CameraConn() 2 { 3 4 videoSource = new VideoCaptureDevice(videoDevices[tscbxCameras.SelectedIndex].MonikerString); 5 videoSource.DesiredFrameSize = new Size(640, 480); 6 videoSource.DesiredFrameRate = 30; 7 videoSource.NewFrame += new NewFrameEventHandler(FinalVideo_NewFrame); 8 videoSource.Start(); 9 } 10 11 void FinalVideo_NewFrame(object sender, NewFrameEventArgs eventArgs) 12 { 13 Bitmap video = (Bitmap)eventArgs.Frame.Clone(); 14 if (_iniFile.ReadInteger("視頻旋轉0|180", "VideoFlip", 0) == 180) 15 { 16 video.RotateFlip(RotateFlipType.Rotate180FlipX); 17 } 18 picVideo.Image = video; 19 }
原理是獲得一個bitmap對象, 而後把這個bitmap對象反轉, 再賦值到圖片控件上去。 ide
搜索引擎大全:www.helpme.so搜索引擎
熱圖吧:www.retu8.comspa
性感美女:http://www.8kmm.comcode