-1
我用「imwrite」顯示的BackgroundImage是成功的窗口形式顯示的圖像,但它到磁盤損壞:opencv C++:如何在windows窗體應用程序中顯示攝像頭捕獲?
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e)
{
namedWindow("video",0);
VideoCapture cap(0);
flag = true;
while(flag){
Mat frame;
cap >> frame; // get a new frame from camera
**imwrite("vdo.jpg",frame);**
this->panel1->BackgroundImage = System::Drawing::Image::FromFile("vdo.jpg");
waitKey(5);
delete panel1->BackgroundImage;
this->panel1->BackgroundImage = nullptr;
}
}
當我試圖顯示不imwrite並使用「位圖」,它不會在這裏工作是來源:
this->panel1->BackgroundImage = System::Drawing::Bitmap(frame);
我的代碼有什麼問題嗎?感謝您的幫助:)))
「它不會工作」是不是問題描述 – 2012-03-06 14:22:31
[如何在Windows窗體應用程序中顯示cv :: Mat的可能的重複?](http://stackoverflow.com/questions/9580397/how-to-display-a-cvmat-in-a -Windows形式施用) – mevatron 2012-03-08 04:23:50