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对象反转, 再赋值到图片控件上去。
搜索引擎大全:www.helpme.so
热图吧:www.retu8.com
性感美女:http://www.8kmm.com