国产欧美另类精品又又欠钱_免费自慰AV_免费观看全部A片大全不卡_国产成人综合久久精品小说,Chinese 中国 XXXX 乱子 a,免费AV无码一区二区,国产三级久久,91在线无,免费黄片视频观看,亚洲国产精品人人做人人爱,中文一区在线

南京軟件定制開發(fā)

南京傾心軟件歡迎您訪問本站

13605185909

新聞資訊

NEWS CENTER
欄目導(dǎo)航

南京軟件開發(fā)之快速搞定攝像頭圖像旋轉(zhuǎn)

發(fā)布時(shí)間:Mar 08, 2022         已有 人瀏覽
經(jīng)常會(huì)遇到的一個(gè)問題,,攝像頭顯示出來的圖像是鏡像,與我們真實(shí)情況正好相反,,
那么下面的代碼可以幫你快速實(shí)現(xiàn)旋轉(zhuǎn)。

// 指定圖像的旋轉(zhuǎn)程度和用于翻轉(zhuǎn)圖像的軸。
public void videoSourcePlayer_NewFrame(object sender, ref Bitmap image)
        {
            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;
                }
 
 
                // 實(shí)時(shí)按角度繪制
                image.RotateFlip(pType);
            }
        }
 
        /// <summary>
        /// 旋轉(zhuǎn)函數(shù),,外部調(diào)用觸發(fā)
        /// </summary>
        public void Rotate()
        {
            // 計(jì)算角度,類變量
            dAngle = dAngle + 90;
            dAngle = dAngle % 360;
            
            // 事件綁定,,實(shí)時(shí)繪制,,達(dá)到效果,本來就是實(shí)時(shí)繪制的原理
            videoSourcePlayer.NewFrame -= new VideoSourcePlayer.NewFrameHandler(videoSourcePlayer_NewFrame);
            videoSourcePlayer.NewFrame += new VideoSourcePlayer.NewFrameHandler(videoSourcePlayer_NewFrame);
        }

 
是不是非常方便且快速呢,,歡迎來交流討論,。
Copyright © 2020-2022 南京傾心軟件技術(shù)有限公司 版權(quán)所有     蘇ICP備2020070309號(hào)-1
QQ在線咨詢
13605185909
返回頂部