예제 #1
0
        private ClassBreakRenderStruct ExportClassBreakRender(MapObjects2.ClassBreaksRenderer render)
        {
            ClassBreakRenderStruct oClassBreakRender = new ClassBreakRenderStruct();
            short iIndex = 0;

            oClassBreakRender.BreakCount     = render.BreakCount;
            oClassBreakRender.DrawBackground = render.DrawBackground;
            oClassBreakRender.Field          = render.Field;
            oClassBreakRender.SymbolType     = (short)render.SymbolType;
            oClassBreakRender.Tag            = render.Tag;

            double dBreak = render.get_Break(iIndex);

            while (dBreak != double.NaN)
            {
                oClassBreakRender.BreakList.Add(dBreak);

                iIndex++;

                try
                {
                    dBreak = render.get_Break(iIndex);
                }
                catch
                {
                    break;
                }
            }

            oClassBreakRender.StartColor = System.Drawing.ColorTranslator.FromWin32((int)render.get_Symbol((short)0).Color);
            oClassBreakRender.EndColor   = System.Drawing.ColorTranslator.FromWin32((int)render.get_Symbol((short)(render.BreakCount - 1)).Color);

            return(oClassBreakRender);
        }
예제 #2
0
        private GroupRenderStruct ExportGroupRender(MapObjects2.GroupRenderer render)
        {
            GroupRenderStruct oGroupRender = new GroupRenderStruct();
            short             iIndex       = 0;

            oGroupRender.DrawBackground = render.DrawBackground;
            oGroupRender.Tag            = render.Tag;

            object oMapSubRender = render.get_Renderer(iIndex);

            while (oMapSubRender != null)
            {
                if (oMapSubRender is MapObjects2.ValueMapRenderer)
                {
                    ValueRenderStruct oValueRender = this.ExportValueRender(oMapSubRender as MapObjects2.ValueMapRenderer);
                    oGroupRender.RenderList.Add(oValueRender);
                }
                else if (oMapSubRender is MapObjects2.ClassBreaksRenderer)
                {
                    ClassBreakRenderStruct oClassBreakRender = this.ExportClassBreakRender(oMapSubRender as MapObjects2.ClassBreaksRenderer);
                    oGroupRender.RenderList.Add(oClassBreakRender);
                }
                else if (oMapSubRender is MapObjects2.LabelRenderer)
                {
                    LabelRenderStruct oLabelRender = this.ExportLabelRender(oMapSubRender as MapObjects2.LabelRenderer);
                    oGroupRender.RenderList.Add(oLabelRender);
                }

                iIndex++;

                try
                {
                    oMapSubRender = render.get_Renderer(iIndex);
                }
                catch
                {
                    break;
                }
            }


            return(oGroupRender);
        }
예제 #3
0
        public MapObjects2.ClassBreaksRenderer GetClassBreakRender(ClassBreakRenderStruct render)
        {
            MapObjects2.ClassBreaksRenderer oMapRender = new MapObjects2.ClassBreaksRendererClass();
            short iIndex = 0;

            oMapRender.BreakCount     = render.BreakCount;
            oMapRender.DrawBackground = render.DrawBackground;
            oMapRender.Field          = render.Field;
            oMapRender.SymbolType     = (MapObjects2.SymbolTypeConstants)render.SymbolType;
            oMapRender.Tag            = render.Tag;

            foreach (double dBreak in render.BreakList)
            {
                oMapRender.set_Break(iIndex, dBreak);

                iIndex++;
            }

            oMapRender.RampColors((uint)Converter.ConvertSystemtoIntegerColor(render.StartColor), (uint)Converter.ConvertSystemtoIntegerColor(render.EndColor));

            return(oMapRender);
        }