1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 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();方法就可以了。 |
转自:http://Www.CnBlogs.Com/WebEnh/
如果想下次快速找到我,记得点下面的关注哦!
本博客Android APP 下载 |
![]() |
支持我们就给我们点打赏 |
![]() |
支付宝打赏 支付宝扫一扫二维码 |
![]() |
微信打赏 微信扫一扫二维码 |
![]() |
如果想下次快速找到我,记得点下面的关注哦!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)