1.dll和命名空间就不在此列举了,如下只是将转换方法介绍: 第一个函数: public void Rotate90() { // 计算角度,类变量 //dAngle = dAngle + 90; //dAngle = dAngle % 360; // 事件绑定,实时绘制,达到效果,本来就是实时绘制的原理 videoSourcePlayer1.NewFrame -= new VideoSourcePlayer.NewFrameHandler(videoSourcePlayer_NewFrame); videoSourcePlayer1.NewFrame += new VideoSourcePlayer.NewFrameHandler(videoSourcePlayer_NewFrame); } 第二个函数: public void videoSourcePlayer_NewFrame(object sender, ref Bitmap image) { int dAngle = 90; if (image != null) { RotateFlipType pType = RotateFlipType.RotateNoneFlipNone; if (dAngle == 0) { pType = RotateFlipType.RotateNoneFlipNone; } else if (dAngle == 90) { pType = RotateFlipType.Rotate90FlipNone; } else if (dAngle == 180) { pType = RotateFlipType.Rotate180FlipNone; } else if (dAngle == 270) { pType = RotateFlipType.Rotate270FlipNone; } // 实时按角度绘制 image.RotateFlip(pType); } } 直接在要调节摄像头的地方调用Rotate90();方法就可以了。
标签:videoSourcePlayer,C#,dAngle,pType,Afroge,RotateFlipType,90,NewFrame From: https://www.cnblogs.com/webenh/p/17074483.html