示例#1
0
// Update the listbox from lst_img_files
void camera_calib_guiDialog::updateListOfImages()
{
	lbFiles->Clear();
	for (TCalibrationImageList::iterator s=lst_images.begin();s!=lst_images.end();++s)
		lbFiles->Append(_U(s->first.c_str()));

	btnSaveImages->Enable( !lst_images.empty() );

	refreshDisplayedImage();
}
示例#2
0
void camera_calib_guiDialog::OnbtnSaveImagesClick(wxCommandEvent& event)
{
	try
	{
		if (lst_images.empty()) return;

		wxDirDialog  dlg(this,_("Select the directory where to save the images"),_("."));

		if (dlg.ShowModal()==wxID_OK)
		{
			string dir = string(dlg.GetPath().mb_str());

			for (TCalibrationImageList::iterator s=lst_images.begin();s!=lst_images.end();++s)
				s->second.img_original.saveToFile( dir+string("/")+s->first+string(".png") );
		}
	}
	catch(std::exception &e)
	{
		wxMessageBox(_U(e.what()),_("Error"),wxICON_INFORMATION,this);
	}
}