Exemplo n.º 1
0
        private void advTreeCoord_NodeClick(object sender, TreeNodeMouseEventArgs e)
        {
            if (e.Node.Text.Contains(".prj") == true)
            {
                string fileFullPath = "";
                string fileFullName = e.Node.Text;
                int    depthIndex   = e.Node.Level;
                Node   curnode      = new Node();
                curnode = e.Node;
                for (int i = depthIndex; i > 1; i--)
                {
                    fileFullName = curnode.Parent.Text + "\\" + fileFullName;
                    curnode      = curnode.Parent;
                }
                fileFullPath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Coordinate Systems\" + fileFullName;

                ISpatialReferenceFactory pSpatialReferenceFactory = new SpatialReferenceEnvironmentClass();
                try
                {
                    ISpatialReference pSpatialReference = pSpatialReferenceFactory.CreateESRISpatialReferenceFromPRJFile(fileFullPath);
                    if (pSpatialReference == null)
                    {
                        return;
                    }
                    pSpaReference = pSpatialReference;

                    richTextReference.Text = ClsGDBDataCommon.GetReferenceString(pSpatialReference);
                }
                catch (Exception ee)
                {
                    MessageBox.Show(ee.Message);
                }
            }
        }
Exemplo n.º 2
0
        private void FrmCoordinateSystem_Load(object sender, EventArgs e)
        {
            switch (startPosition)
            {
            case "startFromMap":
                DirectoryInfo CoordDirInfo = new DirectoryInfo(ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Coordinate Systems");
                LoadDirectories(advTreeCoord.Nodes[0], CoordDirInfo);

                richTextReference.Text = ClsGDBDataCommon.GetReferenceString(pMapControl.SpatialReference);
                IEngineEditor pEngineEdit = new EngineEditorClass();
                if (pEngineEdit.Map == pMapControl.Map)
                {
                    advTreeCoord.Enabled = false;
                    MessageBox.Show("该图层处在编辑状态不能修改坐标系统", "提示", MessageBoxButtons.YesNo);
                }
                break;

            case "startFromLayer":
                DirectoryInfo CoordDirInfoLayer = new DirectoryInfo(ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Coordinate Systems");
                LoadDirectories(advTreeCoord.Nodes[0], CoordDirInfoLayer);
                IGeoDataset       geoDataset = pLayer as IGeoDataset;
                ISpatialReference reference  = geoDataset.SpatialReference;

                richTextReference.Text = ClsGDBDataCommon.GetReferenceString(reference);
                break;
            }
        }
Exemplo n.º 3
0
        private void FrmSymbolStyle_Load(object sender, EventArgs e)
        {
            //遍历文件
            DirectoryInfo theFolder = new DirectoryInfo(ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\");

            FileInfo[] fileInfo = theFolder.GetFiles();
            //样式数量
            int StyleNumber = 0;

            foreach (FileInfo NextFile in fileInfo)  //遍历文件获取数量
            {
                StyleNumber++;
            }
            DevComponents.DotNetBar.BaseItem[] BaseItem = new DevComponents.DotNetBar.BaseItem[StyleNumber];
            int N = 0;

            foreach (FileInfo NextFile in fileInfo)  //遍历文件加载名称
            {
                DevComponents.DotNetBar.CheckBoxItem CheckBox = new DevComponents.DotNetBar.CheckBoxItem();
                CheckBox.Name = NextFile.Name;
                CheckBox.Text = NextFile.Name;
                for (int i = 0; i < SelectStylePath.Length; i++)
                {
                    string FileName = System.IO.Path.GetFileName(SelectStylePath[i]);
                    if (FileName == CheckBox.Text && FileName != null)
                    {
                        CheckBox.Checked = true;
                    }
                }
                BaseItem[N] = CheckBox;
                N++;
            }
            this.itemPanelStyleList.Items.AddRange(BaseItem);
            this.itemPanelStyleList.Refresh();
        }
Exemplo n.º 4
0
        private void FrmFrameBackground_Load(object sender, EventArgs e)
        {
            //加载背景样式
            string EsriStylePathFram = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";

            axSymbologyCtlFrame.LoadStyleFile(EsriStylePathFram);
            axSymbologyCtlFrame.StyleClass = esriSymbologyStyleClass.esriStyleClassBackgrounds;
            if (SymbolBackground != null)
            {
                pStyleGalleryItem.Item = SymbolBackground;

                IFillSymbol pFS = SymbolBackground.FillSymbol;
                this.SizeBackgroundOutline.Text = pFS.Outline.Width.ToString();

                IColor pFillColor = pFS.Color;
                Color  pColorFill = ColorTranslator.FromOle(pFillColor.RGB);
                colorFill.SelectedColor = pColorFill;

                IColor pOutlineColor = pFS.Outline.Color;
                Color  pColorOutline = ColorTranslator.FromOle(pOutlineColor.RGB);
                colorOutline.SelectedColor = pColorOutline;
            }
            else
            {
                SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassBackgrounds);
            }
        }
Exemplo n.º 5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                string szFilename = txtXmlFilename.Text;
                if (!string.IsNullOrEmpty(szFilename))
                {
                    File.Delete(szFilename);
                }
                else
                {
                    DateTime dt         = DateTime.Now;
                    string   szAppendix = "_" + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + "_" + dt.Hour.ToString() + dt.Minute.ToString() + dt.Second.ToString();
                    szFilename = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\ModelInfo" + szAppendix + ".xml";
                }

                writeModelInfoToXml(szFilename);

                //更新图层
                if (m_pRasterLayer != null)
                {
                    ClsAddModelToTerrain pAddModelToTerrain = new ClsAddModelToTerrain();
                    pAddModelToTerrain.addModelToTerrain(szFilename, m_pRasterLayer);
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 6
0
        public bool InitialZF_FileType(List <_ZF_FILETYPE> listFielType)
        {
            string strFile = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Configure\ZF_FileType.cfg";

            //读取文件
            try
            {
                //string strFileName = dlg.FileName;
                StreamReader sr      = new StreamReader(strFile, System.Text.Encoding.Default);
                string       strTemp = "";
                while (sr.Peek() >= 0)
                {
                    _ZF_FILETYPE fileType = new _ZF_FILETYPE();
                    strTemp = sr.ReadLine();
                    string[] strSplitLine;
                    char[]   c = new char[] { ' ' };
                    strSplitLine = strTemp.Split(c, StringSplitOptions.RemoveEmptyEntries);
                    if (strSplitLine.Length >= 3)
                    {
                        fileType.nCode          = int.Parse(strSplitLine[0]);
                        fileType.strFileType    = strSplitLine[1];
                        fileType.strDescription = strSplitLine[2];
                    }
                    listFielType.Add(fileType);
                }
                sr.Close();
            }
            catch (Exception ee)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 7
0
 private void FrmNorthArrow_Load(object sender, EventArgs e)
 {
     try
     {
         //加载指北针样式
         string EsriStylePath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";
         axSymbologyControl.LoadStyleFile(EsriStylePath);
         axSymbologyControl.StyleClass = esriSymbologyStyleClass.esriStyleClassNorthArrows;
         ISymbologyStyleClass symbologyStyleClass = axSymbologyControl.GetStyleClass(axSymbologyControl.StyleClass);
         if (m_pNorthArrow != null)
         {
             m_pStyleGalleryItem      = new ServerStyleGalleryItem();
             m_pStyleGalleryItem.Item = m_pNorthArrow;
             symbologyStyleClass.AddItem(m_pStyleGalleryItem, 0);
         }
         symbologyStyleClass.SelectItem(0);
         ////选择第一个指北针样式为预定样式
         //SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassNorthArrows);
         ////默认设置
         //角度设置
         this.NorthArrowAngle.Value = 0;
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 8
0
        private void InitialColorRamp(esriSymbologyStyleClass styleClass)
        {
            if (m_pRasterRenderer is IRasterStretchColorRampRenderer)
            {
                //得到当前栅格拉伸渲染样式
                IRasterStretchColorRampRenderer rasterStrecthcRenderer = m_pRasterRenderer as IRasterStretchColorRampRenderer;

                //从文件打开渲染库
                string sInstall = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";
                axSymbologyControl1.LoadStyleFile(sInstall);
                axSymbologyControl1.StyleClass = esriSymbologyStyleClass.esriStyleClassColorRamps;
                pSymbolClass = axSymbologyControl1.GetStyleClass(esriSymbologyStyleClass.esriStyleClassColorRamps);

                IStyleGalleryItem pStyleGalleryItem = new ServerStyleGalleryItem();
                pStyleGalleryItem.Item = rasterStrecthcRenderer.ColorRamp;
                pSymbolClass.AddItem(pStyleGalleryItem, 0);

                //将渲染库中所有渲染方式添加到列表中
                for (int i = 0; i < pSymbolClass.ItemCount; i++)
                {
                    stdole.IPictureDisp pPicture = pSymbolClass.PreviewItem(pSymbolClass.GetItem(i), cmbColorRamp.Width, cmbColorRamp.Height);
                    Image image = Image.FromHbitmap(new System.IntPtr(pPicture.Handle));
                    cmbColorRamp.Items.Add(image);
                }
                if (pSymbolClass.ItemCount > 0)
                {
                    pSymbolClass.SelectItem(0);
                }
                if (cmbColorRamp.Items.Count > 0)
                {
                    cmbColorRamp.SelectedIndex = 0;
                }
            }
        }
Exemplo n.º 9
0
        private void FrmSymbol_Load(object sender, EventArgs e)
        {
            //几个设计小界面显示位置
            this.gPanelPoint.Location   = new System.Drawing.Point(256, 151);
            this.gPanelLine.Location    = this.gPanelPoint.Location;
            this.gPanelPolygon.Location = this.gPanelPoint.Location;

            //Get the ArcGIS install location
            string EsriStylePath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";

            axSymbologyControl.LoadStyleFile(EsriStylePath);

            axSymbologyControl.StyleClass = pStyleClass;

            //判读那个设计小界面显示
            if (pStyleClass == esriSymbologyStyleClass.esriStyleClassMarkerSymbols)
            {
                gPanelPoint.Visible   = true;
                gPanelLine.Visible    = false;
                gPanelPolygon.Visible = false;
            }
            else if (pStyleClass == esriSymbologyStyleClass.esriStyleClassLineSymbols)
            {
                gPanelPoint.Visible   = false;
                gPanelLine.Visible    = true;
                gPanelPolygon.Visible = false;
            }
            else if (pStyleClass == esriSymbologyStyleClass.esriStyleClassFillSymbols)
            {
                gPanelPoint.Visible   = false;
                gPanelLine.Visible    = false;
                gPanelPolygon.Visible = true;
            }
        }
Exemplo n.º 10
0
        private void FrmFrameBorder_Load(object sender, EventArgs e)
        {
            //加载边框样式
            string EsriStylePathFram = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";

            axSymbologyCtlFrame.LoadStyleFile(EsriStylePathFram);
            axSymbologyCtlFrame.StyleClass = esriSymbologyStyleClass.esriStyleClassBorders;

            if (SymbolBorder != null)
            {
                pStyleGalleryItem.Item = SymbolBorder;

                ILineSymbol PLS = SymbolBorder.LineSymbol;
                this.SizeBorder.Text = PLS.Width.ToString();
                IColor pLineColor = PLS.Color;
                Color  pColor     = ColorTranslator.FromOle(pLineColor.RGB);
                colorBorder.SelectedColor = pColor;
                pLineSymbol = null;

                PreviewImage();
            }
            else
            {
                SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassBorders);
            }
        }
Exemplo n.º 11
0
        private void FrmScaleBar_Load(object sender, EventArgs e)
        {
            try
            {
                //添加比例尺样式
                string EsriStylePath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";
                axSymbologyControl.LoadStyleFile(EsriStylePath);

                axSymbologyControl.StyleClass = StyleClass;

                if (StyleClass == esriSymbologyStyleClass.esriStyleClassScaleBars)
                {
                    this.Text = "图形比例尺";
                    SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassScaleBars, 0);
                }
                else if (StyleClass == esriSymbologyStyleClass.esriStyleClassScaleTexts)
                {
                    this.Text = "文字比例尺";
                    SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassScaleTexts, 1);
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 12
0
        private void FrmLegendStyle_Load(object sender, EventArgs e)
        {
            //加载图例样式
            string EsriStylePathFram = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";

            axSymbologyCtlLegendItem.LoadStyleFile(EsriStylePathFram);
            axSymbologyCtlLegendItem.StyleClass = esriSymbologyStyleClass.esriStyleClassLegendItems;
        }
Exemplo n.º 13
0
        private void FrmSymboloTin_Load(object sender, EventArgs e)
        {
            string sInstall = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";

            axSymbologyControl1.LoadStyleFile(sInstall);
            axSymbologyControl1.StyleClass = esriSymbologyStyleClass.esriStyleClassColorRamps;
            pSymbolClass = axSymbologyControl1.GetStyleClass(esriSymbologyStyleClass.esriStyleClassColorRamps);



            /* *********************************
            * 生成色度带
            * *********************************/

            for (int i = 0; i < pSymbolClass.get_ItemCount(pSymbolClass.StyleCategory); i++)
            {
                stdole.IPictureDisp pPicture = pSymbolClass.PreviewItem(pSymbolClass.GetItem(i), cmbcolor.Width, cmbcolor.Height);
                Image image = Image.FromHbitmap(new System.IntPtr(pPicture.Handle));
                cmbcolor.Items.Add(image);
            }

            if (cmbcolor.Items.Count > 0)
            {
                cmbcolor.SelectedIndex = 0;
            }

            /* *********************************
            * 初始化gridview及颜色控件
            * *********************************/

            if (pTLayer.GetRenderer(0).GetType().Name == "TinFaceRendererClass" || pTLayer.GetRenderer(0).Name == "Faces")
            {
                treeshow.SelectedIndex = 1;
                ITinSingleSymbolRenderer pTinrenderer = pTLayer.GetRenderer(0) as ITinSingleSymbolRenderer;
                ISimpleFillSymbol        psymbol      = new SimpleFillSymbolClass();
                psymbol = pTinrenderer.Symbol as ISimpleFillSymbol;
                btncolor.SelectedColor = ClsGDBDataCommon.IColorToColor(psymbol.Color);
                istrue = true;
            }
            else if (pTLayer.GetRenderer(0).Name == "Elevation" || pTLayer.GetRenderer(0).Name == "Edge types")
            {
                treeshow.SelectedIndex = 0;
                btncolor.SelectedColor = System.Drawing.Color.Green;
                for (int j = 0; j < pTLayer.RendererCount; j++)
                {
                    if (pTLayer.GetRenderer(j).Name == "Elevation")
                    {
                        ptinColorRampRenderer = pTLayer.GetRenderer(j) as ITinColorRampRenderer;
                        break;
                    }
                }
                cmbclasses.SelectedIndex = ptinColorRampRenderer.BreakCount - 1;
                initialupdatagrid();
            }
        }
Exemplo n.º 14
0
        private void btn2D_Click(object sender, EventArgs e)
        {
            try
            {
                IGraphicsContainer pGraphicsContainer = pPageLayoutControl.ActiveView.GraphicsContainer as IGraphicsContainer;
                IMarkerElement     pMarkerElement     = new MarkerElementClass();

                //////正北方向
                //IPictureMarkerSymbol pPMarkerNorth = new PictureMarkerSymbolClass();
                //string MarkerNorthPath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\BMP\NorthArrow.emf";
                //pPMarkerNorth.CreateMarkerSymbolFromFile(esriIPictureType.esriIPictureEMF, MarkerNorthPath);
                //pPMarkerNorth.Angle = 0;
                //pPMarkerNorth.Size = 100;

                ////太阳方向
                IPictureMarkerSymbol pPMarkerSun = new PictureMarkerSymbolClass();
                string MarkerSunPath             = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\BMP\SunArrow.emf";
                pPMarkerSun.CreateMarkerSymbolFromFile(esriIPictureType.esriIPictureEMF, MarkerSunPath);
                pPMarkerSun.Angle = (-1) * SunAzimuth.Value;
                pPMarkerSun.Size  = 100;

                ////地球方向
                IPictureMarkerSymbol pPMarkerEarth = new PictureMarkerSymbolClass();
                string MarkerEarthPath             = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\BMP\EarthArrow.emf";
                pPMarkerEarth.CreateMarkerSymbolFromFile(esriIPictureType.esriIPictureEMF, MarkerEarthPath);
                pPMarkerEarth.Angle = (-1) * EarAzimuth.Value;
                pPMarkerEarth.Size  = 100;


                IMultiLayerMarkerSymbol pMultiLayerMarkerSymbol = new MultiLayerMarkerSymbolClass();
                //pMultiLayerMarkerSymbol.AddLayer(pPMarkerNorth);
                pMultiLayerMarkerSymbol.AddLayer(pPMarkerSun);
                pMultiLayerMarkerSymbol.AddLayer(pPMarkerEarth);

                pMarkerElement.Symbol = pMultiLayerMarkerSymbol;
                IElement    pElement    = pMarkerElement as IElement;
                IActiveView pActiveView = pPageLayoutControl.ActiveView;
                IPageLayout pPageLayout = (IPageLayout)pActiveView;
                IPage       pPage       = pPageLayout.Page;
                double      pWidth      = pPage.PrintableBounds.XMin + 3;
                double      pHeigth     = pPage.PrintableBounds.YMax - 5;
                IPoint      pPoint      = new PointClass();
                pPoint.PutCoords(pWidth, pHeigth);
                pElement.Geometry = (IGeometry)pPoint;
                pGraphicsContainer.AddElement(pElement, 0);

                pPageLayoutControl.ActiveView.Refresh();
            }
            catch
            {
                MessageBox.Show(e.ToString());
            }

            this.Close();
        }
Exemplo n.º 15
0
        private void btOK_Click(object sender, EventArgs e)
        {
            int SelectItemNumber = itemPanelStyleList.SelectedItems.Count;

            //SelectStylePath = new string[SelectItemNumber];
            for (int i = 0; i < SelectItemNumber; i++)
            {
                SelectStylePath[i] = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\" + itemPanelStyleList.SelectedItems[i].Text;
            }
            this.Hide();
        }
Exemplo n.º 16
0
        private void FrmPatchLineAndArea_Load(object sender, EventArgs e)
        {
            string EsriStylePathFram = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";

            axSymbologyCtlFrame.LoadStyleFile(EsriStylePathFram);
            axSymbologyCtlFrame.StyleClass = SymbolStyle;
            if (SymbolStyle == esriSymbologyStyleClass.esriStyleClassLinePatches)
            {
                this.Text = "线";
            }
            else
            {
                this.Text = "面积";
            }
        }
Exemplo n.º 17
0
        private void btnOpenXML_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "Excel文件(*.xls)|*.xls;*.xlsx|All files (*.*)|*.*";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                XMLPath        = dlg.FileName;
                textBoxX1.Text = XMLPath;
                //string filename = System.IO.Path.GetDirectoryName(XMLPath)+"\\shp\\" + System.IO.Path.GetFileNameWithoutExtension(XMLPath) + ".shp";
                //textBoxX2.Text = filename;
            }
            if (XMLPath.Contains("中线成果"))
            {
                textBoxX3.Text = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\MapTemplate\中线成果点.mxd";
            }
            else if (XMLPath.Contains("桩"))
            {
                textBoxX3.Text = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\MapTemplate\桩.mxd";
            }
        }
Exemplo n.º 18
0
        private void FrmTextSymbol_Load(object sender, EventArgs e)
        {
            //加载样式
            string EsriStylePath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";

            axSymbologyControl.LoadStyleFile(EsriStylePath);
            axSymbologyControl.StyleClass = esriSymbologyStyleClass.esriStyleClassTextSymbols;

            //选择一个样式为默认样式
            SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassTextSymbols);
            //加载字体名称
            InstalledFontCollection pFontCollection = new InstalledFontCollection();

            FontFamily[] pFontFamily = pFontCollection.Families;
            for (int i = 0; i < pFontFamily.Length; i++)
            {
                string pFontName = pFontFamily[i].Name;
                this.cmbBoxFontName.Items.Add(pFontName);
            }
            this.cmbBoxFontName.Text = "宋体";
        }
Exemplo n.º 19
0
        /// <summary>
        /// 初始化与拉伸相关控件
        /// </summary>
        private void initstreach()
        {
            string sInstall = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Style\ESRI.ServerStyle";

            axSymbologyControl1.LoadStyleFile(sInstall);
            axSymbologyControl1.StyleClass = esriSymbologyStyleClass.esriStyleClassColorRamps;
            pSymbolClass           = axSymbologyControl1.GetStyleClass(esriSymbologyStyleClass.esriStyleClassColorRamps);
            pRasterRender          = pRLayer.Renderer;
            pRasterRenderColorRamp = pRasterRender as IRasterRendererColorRamp;
            //生成色度带
            if (pRasterRender is IRasterStretchColorRampRenderer)
            {
                IStyleGalleryItem pStyleGalleryItem = new ServerStyleGalleryItem();
                pStyleGalleryItem.Item = pRasterRenderColorRamp.ColorRamp;
                pSymbolClass.AddItem(pStyleGalleryItem, 0);
                pSymbolClass.SelectItem(0);
            }
            for (int i = 0; i < pSymbolClass.get_ItemCount(pSymbolClass.StyleCategory); i++)
            {
                stdole.IPictureDisp pPicture = pSymbolClass.PreviewItem(pSymbolClass.GetItem(i), cmbColorRamp.Width, cmbColorRamp.Height);
                Image image = Image.FromHbitmap(new System.IntPtr(pPicture.Handle));
                cmbColorRamp.Items.Add(image);
            }

            if (cmbColorRamp.Items.Count > 0)
            {
                cmbColorRamp.SelectedIndex = 0;
            }
            //判断拉伸方式和拉伸波段
            if (pRasterRender is IRasterStretchColorRampRenderer)
            {
                pSCRampRender  = pRasterRender as IRasterStretchColorRampRenderer;
                pRasterStretch = pRasterRender as IRasterStretch;
                int bandindex = pSCRampRender.BandIndex;
                cmbBand.SelectedIndex = bandindex;
                if (pRasterStretch.StretchType == esriRasterStretchTypesEnum.esriRasterStretch_Custom)
                {
                    cmbStreach.SelectedIndex = 1;
                }
                else if (pRasterStretch.StretchType == esriRasterStretchTypesEnum.esriRasterStretch_MinimumMaximum)
                {
                    cmbStreach.SelectedIndex = 2;
                }
                else if (pRasterStretch.StretchType == esriRasterStretchTypesEnum.esriRasterStretch_StandardDeviations)
                {
                    cmbStreach.SelectedIndex = 3;
                }
                else if (pRasterStretch.StretchType == esriRasterStretchTypesEnum.esriRasterStretch_HistogramEqualize)
                {
                    cmbStreach.SelectedIndex = 4;
                }
                else
                {
                    cmbStreach.SelectedIndex = 0;
                }

                lblminstr.Text = pSCRampRender.LabelLow;
                lblmaxstr.Text = pSCRampRender.LabelHigh;
                txtmin.Text    = pSCRampRender.LabelLow;
                txtmax.Text    = pSCRampRender.LabelHigh;
                if (pRasterStretch.StretchType == esriRasterStretchTypesEnum.esriRasterStretch_MinimumMaximum)
                {
                    txtmax.Visible = true;
                    txtmin.Visible = false;
                }
            }
            else
            {
                cmbBand.SelectedIndex    = 0;
                cmbStreach.SelectedIndex = 0;
            }
            isminmax = true;
        }
Exemplo n.º 20
0
        private void btn3D_Click(object sender, EventArgs e)
        {
            try
            {
                IGraphicsContainer3D graphicsContainer3D = pSceneControl.Scene.ActiveGraphicsLayer as IGraphicsContainer3D;
                graphicsContainer3D.DeleteAllElements();
                pSceneControl.Scene.SceneGraph.RefreshViewers();
                //屏幕大小
                double PageX    = pSceneControl.SceneGraph.Extent.Envelope.XMax;
                double PageY    = pSceneControl.SceneGraph.Extent.Envelope.YMax;
                double PageZ    = pSceneControl.SceneGraph.Extent.Envelope.ZMax;
                double PageXmin = pSceneControl.SceneGraph.Extent.Envelope.XMin;

                double pMarkerSize = (PageX - PageXmin) / 10;

                IMarkerElement pMarkerElement = new MarkerElementClass();
                //正北方向
                IMarker3DSymbol pMarker3DSymbolNorth = new Marker3DSymbolClass();
                string          NorthPath            = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\BMP\NorthArrow.3DS";
                pMarker3DSymbolNorth.CreateFromFile(NorthPath);
                IMarker3DPlacement pMarker3DPlacement = pMarker3DSymbolNorth as IMarker3DPlacement;

                pMarker3DPlacement.Size = pMarkerSize;
                pMarker3DPlacement.SetRotationAngles(-90, 0, 0);

                //IRgbColor pRgbColorNorth = new RgbColorClass();
                //pRgbColorNorth.Red = Color.Black.R;
                //pRgbColorNorth.Green = Color.Black.G;
                //pRgbColorNorth.Blue = Color.Black.B;
                pMarker3DPlacement.Color = ClsGDBDataCommon.ColorToIColor(Color.Black);

                //太阳方向
                IMarker3DSymbol pMarker3DSymbolSun = new Marker3DSymbolClass();
                string          SunPath            = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\BMP\SunArrow.3DS";
                pMarker3DSymbolSun.CreateFromFile(SunPath);
                IMarker3DPlacement pMarker3DPlacement1 = pMarker3DSymbolSun as IMarker3DPlacement;
                pMarker3DPlacement1.Size = pMarkerSize;
                double SunAngleX = SunIncli.Value - 90;
                double SunAngleY = 0;
                double SunAngleZ = 0 - SunAzimuth.Value;
                pMarker3DPlacement1.SetRotationAngles(SunAngleX, SunAngleY, SunAngleZ);

                //IRgbColor pRgbColorSun = new RgbColorClass();
                //pRgbColorSun.Red = Color.Red.R;
                //pRgbColorSun.Green = Color.Red.G;
                //pRgbColorSun.Blue = Color.Red.B;
                pMarker3DPlacement1.Color = ClsGDBDataCommon.ColorToIColor(Color.Red);

                //地球方向
                IMarker3DSymbol pMarker3DSymbolEarth = new Marker3DSymbolClass();
                string          EarthPath            = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\BMP\EarthArrow.3DS";
                pMarker3DSymbolEarth.CreateFromFile(EarthPath);
                IMarker3DPlacement pMarker3DPlacement2 = pMarker3DSymbolEarth as IMarker3DPlacement;
                pMarker3DPlacement2.Size = pMarkerSize;

                double EarthAngleX = EarIncli.Value - 90;
                double EarthAngleY = 0;
                double EarthAngleZ = 0 - EarAzimuth.Value;
                pMarker3DPlacement2.SetRotationAngles(EarthAngleX, EarthAngleY, EarthAngleZ);

                //IRgbColor pRgbColorEarth = new RgbColorClass();
                //pRgbColorEarth.Red = Color.BlueViolet.R;
                //pRgbColorEarth.Green = Color.BlueViolet.G;
                //pRgbColorEarth.Blue = Color.BlueViolet.B;
                pMarker3DPlacement2.Color = ClsGDBDataCommon.ColorToIColor(Color.BlueViolet);

                //合并成一个整体
                IMultiLayerMarkerSymbol pMultiLayerMarkerSymbol = new MultiLayerMarkerSymbolClass();
                pMultiLayerMarkerSymbol.AddLayer(pMarker3DSymbolNorth as IMarkerSymbol);
                pMultiLayerMarkerSymbol.AddLayer(pMarker3DSymbolSun as IMarkerSymbol);
                pMultiLayerMarkerSymbol.AddLayer(pMarker3DSymbolEarth as IMarkerSymbol);

                pMarkerElement.Symbol = pMultiLayerMarkerSymbol;
                IElement pElement = pMarkerElement as IElement;

                //确定添加位置
                IPoint pPoint = new PointClass();
                pPoint.X = PageX;
                pPoint.Y = PageY;
                pPoint.Z = PageZ + PageZ / 10;

                IZAware zAware = pPoint as IZAware;
                zAware.ZAware = true;
                IGeometry pointGeometry = pPoint as IGeometry;
                pointGeometry.SpatialReference = pSceneControl.Scene.SpatialReference;
                pElement.Geometry = pointGeometry;

                graphicsContainer3D.AddElement(pElement);
                pSceneControl.Scene.SceneGraph.RefreshViewers();
            }
            catch
            {
                MessageBox.Show(e.ToString());
            }

            this.Close();
        }
Exemplo n.º 21
0
        private void buttonX_ok_Click(object sender, EventArgs e)
        {
            //add all point
            List <IPoint> pointList = new List <IPoint>();
            //add point type
            List <string> typeList = new List <string>();
            //read excel file to creat Field
            string          strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = " + this.textBoxX1.Text + ";Extended Properties=Excel 8.0";
            OleDbConnection conn   = new OleDbConnection(strCon);
            string          sql1   = "select * from [Sheet1$]";

            conn.Open();
            OleDbDataAdapter myCommand = new OleDbDataAdapter(sql1, strCon);
            DataSet          ds        = new DataSet();

            myCommand.Fill(ds);
            conn.Close();

            ISpatialReference pSpaReference = new UnknownCoordinateSystemClass();

            pSpaReference.SetDomain(-8000000, 8000000, -800000, 8000000);
            IFeatureClass pFt = CreateShapeFile(ds, this.textBoxX2.Text, pSpaReference);

            int xindex = 18;
            int yindex = 19;
            int zindex = 20;

            if (ds.Tables[0].Columns[19].ColumnName.ToString().Contains("东坐标"))
            {
                xindex++;
                yindex++;
                zindex++;
            }

            if (pFt == null)
            {
                return;
            }
            else
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    //get type
                    string typeTemp = ds.Tables[0].Rows[i][3].ToString();
                    typeTemp = typeTemp.Split(new char[1] {
                        ' '
                    })[0];
                    //根据XY坐标添加点,edit attribute
                    IsNumberic isNum  = new IsNumberic();
                    IPoint     pPoint = new PointClass();
                    if (isNum.IsNumber(ds.Tables[0].Rows[i][xindex].ToString()) && isNum.IsNumber(ds.Tables[0].Rows[i][yindex].ToString()))
                    {
                        pPoint.X = System.Convert.ToDouble(ds.Tables[0].Rows[i][xindex].ToString());
                        pPoint.Y = System.Convert.ToDouble(ds.Tables[0].Rows[i][yindex].ToString());
                        pPoint.Z = System.Convert.ToDouble(ds.Tables[0].Rows[i][zindex].ToString());
                        IFeature pFeature = pFt.CreateFeature();
                        pFeature.Shape = pPoint;

                        pFeature.Store();
                        for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
                        {
                            //pFeature.set_Value(pFeature.Fields.FindField(ds.Tables[0].Columns[j].ColumnName), ds.Tables[0].Rows[i][j]);
                            pFeature.set_Value(j + 2, ds.Tables[0].Rows[i][j].ToString());
                        }
                        pFeature.set_Value(pFeature.Fields.FindField("Type"), typeTemp);
                        pFeature.Store();

                        pointList.Add(pPoint);
                    }
                    else
                    {
                        MessageBox.Show("the" + i + "rows x and y value is unvalid!");
                    }
                }
            }

            ClsGDBDataCommon processDataCommon = new ClsGDBDataCommon();
            string           strInputPath      = System.IO.Path.GetDirectoryName(textBoxX2.Text);
            string           strInputName      = System.IO.Path.GetFileName(textBoxX2.Text);

            IFeatureLayer pFeatureLayer = new FeatureLayerClass();

            pFeatureLayer.FeatureClass = pFt;
            pFeatureLayer.Name         = System.IO.Path.GetFileNameWithoutExtension(System.IO.Path.GetFileNameWithoutExtension(strInputName)) + "_point";

            //create line shape file
            IPointCollection PointCollection = ReadPoint(pFeatureLayer);
            string           lineName        = strInputPath + "\\" + System.IO.Path.GetFileNameWithoutExtension(strInputName) + "_line.shp";

            CreateLineShpFile(lineName, pSpaReference);
            //将所有的点连接成线
            List <IPolyline> Polyline       = CreatePolyline(PointCollection);
            List <double>    lineLengthList = new List <double>();
            //将连接成的线添加到线图层中
            string pLineFile = lineName;
            string pFilePath = System.IO.Path.GetDirectoryName(pLineFile);
            string pFileName = System.IO.Path.GetFileName(pLineFile);
            //打开工作空间
            IWorkspaceFactory pWSF = new ShapefileWorkspaceFactoryClass();
            IFeatureWorkspace pWS  = (IFeatureWorkspace)pWSF.OpenFromFile(pFilePath, 0);
            //写入实体对象
            IFeatureLayer plineLayer = new FeatureLayerClass();

            plineLayer.FeatureClass = pWS.OpenFeatureClass(pFileName);
            AddFeature(plineLayer, Polyline, pointList, lineLengthList);
            plineLayer.Name = pFeatureLayer.Name + "_line";

            m_pMapCtl.AddLayer(plineLayer as ILayer, 0);
            m_pMapCtl.AddLayer(pFeatureLayer as ILayer, 0);
            m_pMapCtl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);

            ImpSymbolFromFile(textBoxX3.Text, pFeatureLayer, plineLayer);

            //export doc file
            string TemplateFileName = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\WordTemplate\内检测报告.doc";

            exportDocFile(TemplateFileName, textBoxX4.Text, lineLengthList);

            //#region 读取SHP文件
            //IWorkspace pWorkspace = processDataCommon.OpenFromShapefile(strInputPath);
            //IFeatureWorkspace pFeatureWorkspace = pWorkspace as IFeatureWorkspace;
            //IFeatureClass pInputFC = pFeatureWorkspace.OpenFeatureClass(strInputName);
            //#endregion

            //IFeatureLayer pFeatureLayer = new FeatureLayerClass();
            //pFeatureLayer.FeatureClass = pInputFC;
            //pFeatureLayer.Name = strInputName;
            //m_pMapCtl.AddLayer(pFeatureLayer as ILayer, 0);
            //m_pMapCtl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);

            this.Close();
        }
Exemplo n.º 22
0
        private void exportDocFile(string TemplateFileName, string saveFileName, List <double> lineLengthList)
        {
            GC.Collect();
            int[] lineCount = new int[6] {
                0, 0, 0, 0, 0, 0
            };
            double[] linePercent = new double[6] {
                0, 0, 0, 0, 0, 0
            };
            string[] lineName = new string[6] {
                "", "", "", "", "", ""
            };
            double[] linePercentSum = new double[6] {
                0, 0, 0, 0, 0, 0
            };
            for (int i = 0; i < lineLengthList.Count; i++)
            {
                if (lineLengthList[i] >= 0 && lineLengthList[i] < 2)
                {
                    lineCount[0]++;
                    lineName[0] = "[0,2)";
                }
                else if (lineLengthList[i] >= 2 && lineLengthList[i] < 5)
                {
                    lineCount[1]++;
                    lineName[1] = "[2,5)";
                }
                else if (lineLengthList[i] >= 5 && lineLengthList[i] < 10)
                {
                    lineCount[2]++;
                    lineName[2] = "[5,10)";
                }
                else if (lineLengthList[i] >= 10 && lineLengthList[i] < 11.5)
                {
                    lineCount[3]++;
                    lineName[3] = "[10,11.5)";
                }
                else if (lineLengthList[i] >= 11.5 && lineLengthList[i] < 12.3)
                {
                    lineCount[4]++;
                    lineName[4] = "[11.5,12.3)";
                }
                else if (lineLengthList[i] >= 12.3)
                {
                    lineCount[5]++;
                    lineName[5] = ">=12.3";
                }
            }
            for (int i = 0; i < 6; i++)
            {
                linePercent[i] = Math.Round((double)lineCount[i] * 100 / (double)lineLengthList.Count, 2);
            }

            linePercentSum[0] = linePercent[0] / 100;
            for (int i = 1; i < 6; i++)
            {
                linePercentSum[i] += linePercentSum[i - 1] + linePercent[i] / 100;
            }

            Microsoft.Office.Interop.Word.Application app = new Microsoft.Office.Interop.Word.Application();
            //!<根据模板文件生成新文件框架
            File.Copy(TemplateFileName, saveFileName);
            //!<生成documnet对象
            Microsoft.Office.Interop.Word.Document doc = new Microsoft.Office.Interop.Word.Document();
            //!<打开新文挡
            object objFileName = saveFileName;
            object missing     = System.Reflection.Missing.Value;
            object isReadOnly  = false;
            object isVisible   = false;

            doc = app.Documents.Open(ref objFileName, ref missing, ref isReadOnly, ref missing,
                                     ref missing, ref missing, ref missing, ref missing,
                                     ref missing, ref missing, ref missing, ref isVisible,
                                     ref missing, ref missing, ref missing, ref missing);
            doc.Activate();
            //!<光标转到书签
            int length = 0;

            for (int bookIndex = 1; bookIndex <= 6; bookIndex++)
            {
                object BookMarkName = "tb" + bookIndex.ToString();
                object what         = Microsoft.Office.Interop.Word.WdGoToItem.wdGoToBookmark;
                doc.ActiveWindow.Selection.GoTo(ref what, ref missing, ref missing, ref BookMarkName); //!<定位到书签位置

                doc.ActiveWindow.Selection.TypeText(lineCount[bookIndex - 1].ToString());              //!<在对应书签位置插入内容
                length = lineCount[bookIndex - 1].ToString().Length;
                app.ActiveDocument.Bookmarks.get_Item(ref BookMarkName).End = app.ActiveDocument.Bookmarks.get_Item(ref BookMarkName).End + length;
            }
            for (int bookIndex = 7; bookIndex <= 12; bookIndex++)
            {
                object BookMarkName = "tb" + bookIndex.ToString();
                object what         = Microsoft.Office.Interop.Word.WdGoToItem.wdGoToBookmark;
                doc.ActiveWindow.Selection.GoTo(ref what, ref missing, ref missing, ref BookMarkName); //!<定位到书签位置

                doc.ActiveWindow.Selection.TypeText(linePercent[bookIndex - 7].ToString() + "%");      //!<在对应书签位置插入内容
                length = linePercent[bookIndex - 7].ToString().Length;
                app.ActiveDocument.Bookmarks.get_Item(ref BookMarkName).End = app.ActiveDocument.Bookmarks.get_Item(ref BookMarkName).End + length;
            }

            //生成统计图1
            DataTable  attributeTable = new DataTable("数量");
            DataColumn pDataColumn    = new DataColumn("管节长度");

            pDataColumn.Unique   = true;
            pDataColumn.DataType = System.Type.GetType("System.String");
            attributeTable.Columns.Add(pDataColumn);
            pDataColumn          = null;
            pDataColumn          = new DataColumn("统计值");
            pDataColumn.Unique   = false;
            pDataColumn.DataType = System.Type.GetType("System.Double");
            attributeTable.Columns.Add(pDataColumn);
            pDataColumn = null;

            string jpgpath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\BMP\neijiance.jpg";

            createStatChart(attributeTable, lineCount, linePercent, lineName, jpgpath);

            object BookMarkNameimg = "tb13";
            object whatimg         = Microsoft.Office.Interop.Word.WdGoToItem.wdGoToBookmark;

            doc.ActiveWindow.Selection.GoTo(ref whatimg, ref missing, ref missing, ref BookMarkNameimg); //!<定位到书签位置
            object Anchor           = app.Selection.Range;
            object LinkToFile       = false;
            object SaveWithDocument = true;

            Microsoft.Office.Interop.Word.InlineShape shape = app.ActiveDocument.InlineShapes.AddPicture(jpgpath, ref LinkToFile, ref SaveWithDocument, ref Anchor);
            //shape.Width = 100f;//图片宽度
            //shape.Height = 20f;//图片高度

            //生成统计图2
            DataTable  attributeTable2 = new DataTable("累计比例");
            DataColumn pDataColumn2    = new DataColumn("管节长度");

            pDataColumn2.Unique   = true;
            pDataColumn2.DataType = System.Type.GetType("System.String");
            attributeTable2.Columns.Add(pDataColumn2);
            pDataColumn2          = null;
            pDataColumn2          = new DataColumn("累计值");
            pDataColumn2.Unique   = false;
            pDataColumn2.DataType = System.Type.GetType("System.Double");
            attributeTable2.Columns.Add(pDataColumn2);
            pDataColumn2 = null;

            string jpgpath2 = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\BMP\neijiance2.jpg";

            createStatChart2(attributeTable2, linePercentSum, linePercent, lineName, jpgpath2);

            object BookMarkNameimg2 = "tb14";
            object whatimg2         = Microsoft.Office.Interop.Word.WdGoToItem.wdGoToBookmark;

            doc.ActiveWindow.Selection.GoTo(ref whatimg2, ref missing, ref missing, ref BookMarkNameimg2); //!<定位到书签位置
            object Anchor2           = app.Selection.Range;
            object LinkToFile2       = false;
            object SaveWithDocument2 = true;

            Microsoft.Office.Interop.Word.InlineShape shape2 = app.ActiveDocument.InlineShapes.AddPicture(jpgpath2, ref LinkToFile2, ref SaveWithDocument2, ref Anchor2);
            //shape.Width = 100f;//图片宽度
            //shape.Height = 20f;//图片高度

            //!<输出完毕后关闭doc对象
            object IsSave = true;

            doc.Close(ref IsSave, ref missing, ref missing);

            MessageBox.Show("生成“" + saveFileName + "”成功!");
        }
Exemplo n.º 23
0
 private void FrmImportNeijiance_Load(object sender, EventArgs e)
 {
     textBoxX3.Text = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\MapTemplate\内检测.mxd";
 }
Exemplo n.º 24
0
 private void FrmImportZhongxian_Load(object sender, EventArgs e)
 {
     textBoxX3.Text = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\MapTemplate\中线成果点.mxd";
 }
Exemplo n.º 25
0
        public void matlabCalc(Ex_OriPara ori)
        {
            string       fileDirPath = System.IO.Path.GetDirectoryName(textBoxPicFile.Text);
            string       fileName    = System.IO.Path.GetFileNameWithoutExtension(textBoxPicFile.Text);
            StreamWriter sw          = new StreamWriter(fileDirPath + "\\" + fileName + "_para.txt", false, Encoding.ASCII);

            textBoxParaFile.Text = fileDirPath + "\\" + fileName + "_para.txt";
            double angle;

            angle = doubleInputSunAngle.Value;
            sw.Write(angle.ToString());
            sw.Write("  %太阳方位角,北向为0,-180°(逆时针) 至180°(顺时针)");
            //sw.Write("\n");
            sw.WriteLine();
            //sw.Write("1.22623");
            //sw.Write("0.05");
            sw.Write(doubleInputForcusDis.Value.ToString());
            sw.Write("  %f焦距,像素");
            // sw.Write("\n");
            sw.WriteLine();
            //sw.Write("511.5");
            //sw.Write("587.5");
            sw.Write(doubleInputX0.Value.ToString());
            sw.Write("  %x0");
            //sw.Write("\n");
            sw.WriteLine();
            //sw.Write("511.5");
            //sw.Write("431.5");
            sw.Write(doubleInputY0.Value.ToString());
            sw.Write("  %y0");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.pos.X);
            sw.Write("  %Xs,m%摄影中心位置");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.pos.Y);
            sw.Write("  %Ys");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.pos.Z);
            sw.Write("  %Zs");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.ori.omg * 180 / Math.PI);
            sw.Write("  %omg像点从像空间坐标系转换到站点坐标系的旋转角");
            //sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.ori.phi * 180 / Math.PI);
            sw.Write("  %phi");
            // sw.Write("\n");
            sw.WriteLine();
            sw.Write(ori.ori.kap * 180 / Math.PI);
            sw.Write("  %Kap");
            //sw.Write("\n");
            sw.WriteLine();
            sw.Flush();
            sw.Close();

            string exepath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Skyline\funTianJiXian.exe";
            //string exepath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\rob.exe";
            string ParafilePath = ClsGDBDataCommon.GetParentPathofExe() + @"Resource\Skyline\DetectionPara.txt";

            //ProcessStartInfo startInfo = new ProcessStartInfo(exepath, textBoxPicFile.Text + " " + textBoxParaFile.Text + " "
            //    + ParafilePath);

            //Process p = new Process();
            //p.StartInfo.FileName = excutefile;
            //p.StartInfo.Arguments = excutecmd;
            //p.StartInfo.UseShellExecute = false;
            //p.StartInfo.RedirectStandardInput = true;
            //p.StartInfo.RedirectStandardOutput = true;
            //p.StartInfo.RedirectStandardError = true;
            //p.StartInfo.CreateNoWindow = true;

            //p.Start();
            //p.StandardInput.WriteLine("exit");
            //strOutput = p.StandardOutput.ReadToEnd();

            //p.WaitForExit();
            //p.Close();



            // myprocess.StartInfo = startInfo;


            myprocess.StartInfo.CreateNoWindow  = false;
            myprocess.StartInfo.UseShellExecute = false;

            myprocess.StartInfo.RedirectStandardInput  = true;
            myprocess.StartInfo.RedirectStandardOutput = true;
            myprocess.StartInfo.RedirectStandardError  = true;
            myprocess.StartInfo.Arguments = textBoxPicFile.Text + " " + textBoxParaFile.Text + " "
                                            + ParafilePath;
            myprocess.StartInfo.FileName = exepath;
            myprocess.Start();
            string outPut = myprocess.StandardOutput.ReadToEnd();

            myprocess.StandardInput.WriteLine("exit");
            myprocess.WaitForExit();
        }