1,传递参数开始切图
//pictureDir图片所在文件夹路径
//krpanopath krpano所在文件夹路径
void startKrpano(string krpanopath ,string pictureDir)
{
if (!Directory.Exists(krpanopath))
{
return;
}
var markidconfig = krpanopath + "//templates//vtour-multires.config";
var picturepath = pictureDir + "//*.jpg";
//命令参数,参数用空格隔开,最好写完整路径:makepano .config配置文件 全景图片
string arguments = "makepano -config=" + markidconfig + " " + picturepath;
panoProcess.StartInfo.FileName = krpanopath + "//krpanotools64.exe";//执行程序
panoProcess.StartInfo.Arguments = arguments;//将参数传递进程序
panoProcess.Start();//启动程序
this.timer1.Enabled = true;//winform用timer 其他定时语言 其他定时器也行
}
2,查看进度
//picturepath 图片所在文件夹路径
string checkProcess(string picturepath )
{
//获取文件夹下的所有文件
var files = Directory.GetFiles(picturepath, "*.jpg");
if (Directory.Exists(picturepath + "/vtour/panos"))
{
var dirs = Directory.GetDirectories(picturepath + "/vtour/panos");
if (files.Length == dirs.Length)
{
return "共"+files.length+"张,全部完成";
}else{
return “已经完成”+dirs.length+"张,共"+files.length+"张";
}
}
}