Save Image with saveFileDialog
Hi! I am new to OpenCv and C++.
I word with Visual Studio 2013 and I want save an image with the saveFileDialog or with folderBrowserDialog from windows forms? Is that even possible?
I tried this but I get an error at the line "cv::imwrite(name, image); " : no suitable constructor exists to convert from "System::String^ to cv::String"
saveFileDialog1->Filter = "JPEG Image|*.jpg|Bitmap Image|*.bmp|Gif Image|*.gif";
saveFileDialog1->Title = "Save Image";
saveFileDialog1->ShowDialog();
if (saveFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK){
String^ name = saveFileDialog1->FileName;
cv::imwrite(name, image);
MessageBox::Show("Successfully saved");
}
Any suggestions?
Thanks!
do you have to use managed code ? you could use a simpl imshow(), and press crtl-s on that window.
( calls internal showSaveDialog(CvWindow* window) function)
Yes. I have to create a nice GUI where I can capture images from a webcam, do some transformations, face recognition and then save the new image in any directory... Is it even possible to convert System::String to cv::String?
Oh my God. It works with the conversion... Thanks thanks thanks! You saved my day :D I will keep your warning in my mind ;)