opencv in windows form
I am using now windows form in visual c++. I got an error:
error C2065: 'Filename' : undeclared identifier
error C2065: 'openFileDialog1' : undeclared identifier
error C2227: left of '->FileName' must point to class/struct/union/generic type
I don't know what is wrong in my code. Anyone who can solve this problem?
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
cv::Mat img;
img = cv::imread(openFileDialog1->FileName, CV_LOAD_IMAGE_COLOR);
System::Drawing::Graphics^ graphics = pictureBox1->CreateGraphics();
System::IntPtr ptr(img.ptr());
System::Drawing::Bitmap^ b = gcnew System::Drawing::Bitmap(img.cols,img.rows,img.step,System::Drawing::Imaging::PixelFormat::Format24bppRgb,ptr);
System::Drawing::RectangleF rect(0,0,pictureBox1->Width,pictureBox1->Height);
graphics->DrawImage(b,rect);
}