コード例 #1
0
        private ValueRenderStruct ExportValueRender(MapObjects2.ValueMapRenderer render)
        {
            ValueRenderStruct oValueRender = new ValueRenderStruct();

            this.DeconvertSymbol(render.DefaultSymbol, oValueRender.DefaultSymbol);

            oValueRender.Field         = render.Field;
            oValueRender.RotationField = render.RotationField;
            oValueRender.ScaleField    = render.ScalingField;
            oValueRender.SymbolType    = (short)render.SymbolType;
            oValueRender.Tag           = render.Tag;
            oValueRender.UseDefault    = render.UseDefault;
            oValueRender.ValueCount    = render.ValueCount;

            short iIndex = 0;

            MapObjects2.Symbol oMapSymbol = render.get_Symbol(iIndex);

            while (oMapSymbol != null)
            {
                SymbolStruct oSymbol = new SymbolStruct();
                this.DeconvertSymbol(oMapSymbol, oSymbol);
                oValueRender.SymbolList.Add(oSymbol);

                iIndex++;
                oMapSymbol = render.get_Symbol(iIndex);
            }

            return(oValueRender);
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void mapEye_AfterLayerDraw(object sender, AxMapObjects2._DMapEvents_AfterLayerDrawEvent e)
 {
     if (e.index != 0)
     {
         return;
     }
     symE = new MapObjects2.SymbolClass();
     symE.OutlineColor = (uint)MapObjects2.ColorConstants.moRed;
     symE.Outline      = true;
     symE.SymbolType   = MapObjects2.SymbolTypeConstants.moFillSymbol;
     symE.Style        = (short)MapObjects2.FillStyleConstants.moTransparentFill;
     mapEye.DrawShape(mapMain.Extent, symE);
     MapObjects2.TextSymbol tsy = new MapObjects2.TextSymbolClass();
 }
コード例 #3
0
 private void DeconvertSymbol(MapObjects2.Symbol fromSymbol, SymbolStruct toSymbol)
 {
     toSymbol.CenterOnAscent = fromSymbol.CenterOnAscent;
     toSymbol.CharacterIndex = fromSymbol.CharacterIndex;
     toSymbol.FillColor      = System.Drawing.ColorTranslator.FromWin32((int)fromSymbol.Color);
     toSymbol.CustomSymbol   = fromSymbol.Custom;
     toSymbol.FontName       = fromSymbol.Font.Name;
     toSymbol.OutLine        = fromSymbol.Outline;
     toSymbol.OutLineColor   = System.Drawing.ColorTranslator.FromWin32((int)fromSymbol.OutlineColor);
     toSymbol.Rotation       = fromSymbol.Rotation;
     toSymbol.Size           = fromSymbol.Size;
     toSymbol.Style          = fromSymbol.Style;
     toSymbol.SymbolType     = (short)fromSymbol.SymbolType;
 }
コード例 #4
0
 public void ConvertSymbol(SymbolStruct fromSymbol, MapObjects2.Symbol toSymbol)
 {
     toSymbol.CenterOnAscent = fromSymbol.CenterOnAscent;
     toSymbol.CharacterIndex = fromSymbol.CharacterIndex;
     toSymbol.Color          = Convert.ToUInt32(fromSymbol.FillColor.ToArgb());
     toSymbol.Custom         = fromSymbol.CustomSymbol;
     toSymbol.Font.Name      = fromSymbol.FontName;
     toSymbol.Outline        = fromSymbol.OutLine;
     toSymbol.OutlineColor   = Convert.ToUInt32(fromSymbol.OutLineColor.ToArgb());
     toSymbol.Rotation       = fromSymbol.Rotation;
     toSymbol.Size           = fromSymbol.Size;
     toSymbol.Style          = fromSymbol.Style;
     toSymbol.SymbolType     = (MapObjects2.SymbolTypeConstants)fromSymbol.SymbolType;
 }
コード例 #5
0
        public void ConvertSymbol(SymbolStruct fromSymbol, MapObjects2.Symbol toSymbol)
        {
            toSymbol.SymbolType = (MapObjects2.SymbolTypeConstants)fromSymbol.SymbolType;
            toSymbol.Color      = (uint)Converter.ConvertSystemtoIntegerColor(fromSymbol.FillColor);
            // toSymbol.Custom = fromSymbol.CustomSymbol;
            toSymbol.Size  = fromSymbol.Size;
            toSymbol.Style = fromSymbol.Style;

            if (fromSymbol.SymbolType == (short)MapObjects2.SymbolTypeConstants.moPointSymbol)
            {
                toSymbol.CenterOnAscent = fromSymbol.CenterOnAscent;
                toSymbol.CharacterIndex = fromSymbol.CharacterIndex;
                toSymbol.Font.Name      = fromSymbol.FontName;
                toSymbol.Rotation       = fromSymbol.Rotation;
            }
            else if (fromSymbol.SymbolType == (short)MapObjects2.SymbolTypeConstants.moFillSymbol)
            {
                toSymbol.Outline      = fromSymbol.OutLine;
                toSymbol.OutlineColor = (uint)Converter.ConvertSystemtoIntegerColor(fromSymbol.OutLineColor);
            }
        }
コード例 #6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void listBox_SelectedIndexChanged(object sender, System.EventArgs e)
 {
     if (mapMain.TrackingLayer.EventCount > 0)
     {
         mapMain.TrackingLayer.RemoveEvent(0);
     }
     if (listBox.SelectedItems.Count > 0)
     {
         string            slName = listBox.SelectedItem.ToString();
         string            s;
         MapObjects2.Point selectP = new MapObjects2.PointClass();
         for (int i = 0; i < s_Info.Length; i++)
         {
             s = s_Info[i].s_Name + "热力站";
             if (slName == s)
             {
                 selectP.X = System.Convert.ToDouble(s_Info[i].s_East);
                 selectP.Y = System.Convert.ToDouble(s_Info[i].s_West);
                 mapMain.CenterAt(selectP.X, selectP.Y);
                 MapObjects2.Symbol selectS = mapMain.TrackingLayer.get_Symbol(0);
                 selectS.Color = System.Convert.ToUInt32(MapObjects2.ColorConstants.moBlue);
                 selectS.Size  = 10;
                 mapMain.TrackingLayer.AddEvent(selectP, 0);
             }
         }
     }
     if (this.timer1.Enabled == false)
     {
         this.timer1.Enabled = true;
     }
     else
     {
         this.timer1.Enabled = false;
         this.timer1.Enabled = true;
     }
 }
コード例 #7
0
ファイル: frmGisMain.cs プロジェクト: hkiaipc/guye
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void axMap2_AfterLayerDraw(object sender, AxMapObjects2._DMapEvents_AfterLayerDrawEvent e)
 {
     if(e.index!=0)
         return;
     symE=new MapObjects2.SymbolClass();
     symE.OutlineColor=(uint)MapObjects2.ColorConstants.moRed;
     symE.Outline=true;
     symE.SymbolType=MapObjects2.SymbolTypeConstants.moFillSymbol;
     symE.Style=(short)MapObjects2.FillStyleConstants.moTransparentFill;
     axMap2.DrawShape(axMap1.Extent,symE);
     MapObjects2.TextSymbol tsy=new MapObjects2.TextSymbolClass();
 }