Exemplo n.º 1
0
 /// <summary>
 /// 地图就绪事件
 /// </summary>
 /// <param name="e"></param>
 void iMSMap1_MapReady(ZDIMS.Event.IMSMapEvent e)
 {
     if (!DesignerProperties.IsInDesignTool)
     {
         //添加图片填充区域对象
         IMSPictureFillStyle PicFill = new IMSPictureFillStyle();
         //添加对象选择监听事件
         PicFill.ChossedMarkerOverCallBack += new IMSPictureFillStyle.ChossedMarkerHander(callback);
         this.graphicsLayer.AddGraphics(PicFill);//添加对象
         //设置坐标
         PicFill.Points.Add(new Point(8.99919517012924, 29.671057152220655));
         PicFill.Points.Add(new Point(12.99919517012924, 10.671057152220655));
         PicFill.Points.Add(new Point(-40.99919517012924, 12.671057152220655));
         PicFill.Draw();//绘制对象
         //添加预定义多边形对象
         IMSSimpleFillStyle fill = new IMSSimpleFillStyle();
         this.graphicsLayer.AddGraphics(fill);
         fill.ChossedMarkerOverCallBack += callback;//监听选择事件
         //设置坐标
         fill.Points.Add(new Point(10.99919517012924, 29.671057152220655));
         fill.Points.Add(new Point(19.99919517012924, 10.671057152220655));
         fill.Points.Add(new Point(33.99919517012924, 32.671057152220655));
         fill.Draw();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 预定义区填充符号
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void setFillType_DropDownClosed(object sender, EventArgs e)
        {
            if (this.setFillType != null)
            {
                IMSSimpleFillStyle tmp = new IMSSimpleFillStyle();
                if (this._polygonStyle != null)
                {
                    //根据选择的设置填充样式
                    if (this._polygonStyle is IMSSimpleFillStyle)
                    {
                        tmp = this._polygonStyle as IMSSimpleFillStyle;
                    }
                    else
                    {
                        MessageBox.Show("选择几何图形填充区对象");
                        return;
                    }

                    switch (((Image)(this.setFillType.SelectionBoxItem)).Tag.ToString())
                    {
                    case "颜色填充":
                    {
                        tmp.FillSymbol = FillSymbol.Solid;
                        break;
                    }

                    case "斜线":
                    {
                        tmp.FillSymbol = FillSymbol.Slash;
                        break;
                    }

                    case "反斜线":
                    {
                        tmp.FillSymbol = FillSymbol.BackSlash;
                        break;
                    }

                    case "网格":
                    {
                        tmp.FillSymbol = FillSymbol.Cross;
                        break;
                    }

                    case "横线":
                    {
                        tmp.FillSymbol = FillSymbol.Horizontal;
                        break;
                    }

                    case "竖线":
                    {
                        tmp.FillSymbol = FillSymbol.Vertical;
                        break;
                    }
                    }
                }
            }
        }
 /// <summary>
 /// 绘制预定义区填充样式
 /// </summary>
 /// <param name="logPntArr"></param>
 void PrePolygon(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr)
 {
     //初始化区样式对象
     this._polygonStyle = new IMSSimpleFillStyle();
     this.graphicsLayer.AddGraphics(this._polygonStyle); //添加区对象
     this._polygonStyle.FillSymbol = fillType;           //设置填充样式
     //this._polygonStyle.StrokeColor = Colors.LightGray;//多边形边框颜色
     //this._polygonStyle.FillColor = Colors.Red;//填充颜色
     this._polygonStyle.Draw(logPntArr);//绘制多边形
 }
Exemplo n.º 4
0
        /// <summary>
        /// 预定义区边框样式
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void setStrokeType1_DropDownClosed(object sender, EventArgs e)
        {
            if (this.setStrokeType1 != null)
            {
                if (this._polygonStyle != null)
                {
                    if (this._polygonStyle is IMSSimpleFillStyle)
                    {
                        LineType tmp  = LineType.Dot;
                        string   type = ((Image)(this.setStrokeType1.SelectionBoxItem)).Tag.ToString();
                        switch (type)
                        {
                        case "Soild":
                        {
                            tmp = LineType.Solid;
                            break;
                        }

                        case "Dash":
                        {
                            tmp = LineType.Dash;
                            break;
                        }

                        case "DashDot":
                        {
                            tmp = LineType.DashDot;
                            break;
                        }

                        case "Dot":
                        {
                            tmp = LineType.Dot;
                            break;
                        }

                        case "DashDotDot":
                        {
                            tmp = LineType.DashDotDot;
                            break;
                        }
                        }
                        IMSSimpleFillStyle f = this._polygonStyle as IMSSimpleFillStyle;
                        f.StrokeLineSymbol = tmp;//设置边框样式
                    }
                    else
                    {
                        MessageBox.Show("选择几何图形填充区对象");
                        return;
                    }
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 添加多边形事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddPolygon_Click(object sender, RoutedEventArgs e)
        {
            //初始化多边形对象
            IMSSimpleFillStyle fill = new IMSSimpleFillStyle();

            fill.IsShowMenum = true;                                           //容许显示多边形右键菜单
            fill.IsCursor    = true;                                           //鼠标状态为手形
            fill.ChossedMarkerOverCallBack += callback;                        //监听图形选择事件
            this.graphicesLaye.AddGraphics(fill);                              //图形添加到绘图层中
            fill.Points.Add(new Point(10.99919517012924, 29.671057152220655)); //设置多边形的坐标
            fill.Points.Add(new Point(19.99919517012924, 10.671057152220655));
            fill.Points.Add(new Point(12.99919517012924, 30.671057152220655));
            fill.Draw();//绘制多边形
        }
Exemplo n.º 6
0
 private void SetFillOpa_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
 {
     if (this._polygonStyle != null)
     {
         if (this._polygonStyle is IMSSimpleFillStyle)
         {
             IMSSimpleFillStyle tmp = this._polygonStyle as IMSSimpleFillStyle;
             tmp.fillOpacity = ((Slider)sender).Value;//设置填充透明度
         }
         else
         {
             MessageBox.Show("选择几何图形填充区对象");
             return;
         }
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// 颜色选择处理事件
 /// </summary>
 /// <param name="strColor">选择的颜色</param>
 void fillcolorsPicker_ColorChangedOverCallBack(Color strColor)
 {
     //设置填充颜色
     if (this._polygonStyle != null)
     {
         if (this._polygonStyle is IMSSimpleFillStyle)
         {
             IMSSimpleFillStyle tmp = this._polygonStyle as IMSSimpleFillStyle;
             tmp.FillColor = strColor;
         }
         else
         {
             MessageBox.Show("请选择预定义区样式图形!");
             return;
         }
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 设置边框颜色
 /// </summary>
 /// <param name="strColor"></param>
 void colorsPicker_ColorhangedOverCallBack(Color strColor)
 {
     if (this.colorsPicker != null)
     {
         if (this._polygonStyle != null)
         {
             if (this._polygonStyle is IMSSimpleFillStyle)
             {
                 IMSSimpleFillStyle tmp = this._polygonStyle as IMSSimpleFillStyle;
                 tmp.StrokeColor = strColor;//设置边框颜色
             }
             else
             {
                 MessageBox.Show("未选择编辑的几何图形填充区对象!");
                 return;
             }
         }
     }
 }
        /// <summary>
        /// 多边形绘制下拉控件监听事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DrawPolygon_DropDownClosed(object sender, EventArgs e)
        {
            //根据选择类型设置多边形填充样式
            if (this.DrawPolygon != null)
            {
                switch (((Image)(this.DrawPolygon.SelectionBoxItem)).Tag.ToString())
                {
                case "颜色填充":
                {
                    this.fillType = FillSymbol.Solid;
                    break;
                }

                case "斜线":
                {
                    fillType = FillSymbol.Slash;
                    break;
                }

                case "反斜线":
                {
                    fillType = FillSymbol.BackSlash;
                    break;
                }

                case "网格":
                {
                    fillType = FillSymbol.Cross;
                    break;
                }

                case "横线":
                {
                    fillType = FillSymbol.Horizontal;
                    break;
                }

                case "竖线":
                {
                    fillType = FillSymbol.Vertical;
                    break;
                }
                }
                this.drawingCtl.FreeDrawingType = FreeHanderType.None;
                //定义多边形填充样式对象
                IMSSimpleFillStyle fill = new IMSSimpleFillStyle();
                fill.FillSymbol = this.fillType;
                this.graphicsLayer.DrawingObj = fill;
                //设置绘制类型,监听绘制结束事件,绘制区
                this.graphicsLayer.DrawingType = DrawingType.Polygon;
                //移除默认的绘制多边形临时对象
                this.graphicsLayer.RemoveGraphics(this.graphicsLayer.DrawingObj);
                this.graphicsLayer.DrawingObj = fill;//设置自定义临时绘制对象
                //设置临时绘制对象初始不可见
                this.graphicsLayer.DrawingObj.Visibility = System.Windows.Visibility.Collapsed;
                //设置绘制结束事件
                this.graphicsLayer.DrawingOverCallback += new DrawingEventHandler(PrePolygon);
                //将临时绘制对象添加到绘图层
                this.graphicsLayer.AddGraphics(fill);
            }
        }