2013-04-10 417 views
1

任何人都可以幫我解決這個問題嗎?從AForge.Net獲取圖像的一部分videosourceplayer

我把VideoSourcePlayer控件從AForge.Net,一個圖片框和一個按鈕放在窗體上。點擊時,我只想顯示從當前幀到圖片框的區域。我可以使用此代碼顯示整個框架:

Bitmap bitmap = (Bitmap)videoSourcePlayer1.GetCurrentVideoFrame().Clone(); 
pictureBox1.Image = bitmap; 
+1

您可以從位圖的中間影像上繪製的感興趣區域'Graphics.DrawImage',那麼中間圖像分配給圖片框。 – 2013-04-11 09:28:45

+1

謝謝。我解決了調整位圖大小和複製新位圖區域的問題。 – user1429899 2013-04-11 10:19:04

回答

1
Bitmap bitmap = this.VideoSourcePlayer.GetCurrentVideoFrame(); 
+0

非常感謝你 – Sunil 2016-08-16 09:50:57