Beispiel #1
0
        internal static string SaveSn(string MBLConfigurePicPath, double MBLConfigureDPITimes, Canvas mainCanvas, string sNData, string mTMData = "")
        {
            string pathMTM = MBLConfigurePicPath + @"\MTM";

            if (Directory.Exists(pathMTM) == false)//如果不存在就创建file文件夹
            {
                Directory.CreateDirectory(pathMTM);
            }
            string tmp = MBLConfigurePicPath + @"\" + sNData + ".bmp";


            if (!MBXUtils.ExportToPic(tmp, mainCanvas, MBLConfigureDPITimes))
            {
                LogHelper.Log("duplicate: " + sNData);
            }
            if (!string.IsNullOrWhiteSpace(mTMData))
            {
                string tm = pathMTM + @"\" + mTMData + ".bmp";
                if (!File.Exists(tm))
                {
                    File.Copy(tmp, tm, true);
                    LogHelper.Log("New MTM: " + sNData);
                }
            }
            return(tmp);
        }
Beispiel #2
0
        public static string ExportUI(string path, string name, Canvas mainCanvas, OutFileType mOutFileType, double MBLConfigureDPITimes, bool IsLatest)
        {
            if (!IsLatest)
            {
                addwaterprint(mainCanvas);
            }


            if (mOutFileType == OutFileType.Picture)
            {
                string tmppath = path + @"\" + name + ".bmp";

                if (MBXUtils.ExportToPic(tmppath, mainCanvas, MBLConfigureDPITimes))
                {
                    return(tmppath);
                }
                else
                {
                    return(null);
                }
            }
            else if (mOutFileType == OutFileType.Pdf)
            {
                string tmppdf = path + @"\" + name + ".pdf";
                if (ExportToPdf(tmppdf, mainCanvas))
                {
                    return(tmppdf);
                }
                else
                {
                    return(null);
                }
            }
            else if (mOutFileType == OutFileType.Xps)
            {
                string tmpxps = path + @"\" + name + ".xps";
                if (ExportToXps(tmpxps, mainCanvas))
                {
                    return(tmpxps);
                }
                else
                {
                    return(null);
                }
            }
            return(null);
        }