Exemplo n.º 1
0
        protected void DrawSymbol(int int_0, Rectangle rectangle_0, object object_0)
        {
            IDisplayTransformation displayTransformation = new DisplayTransformation() as IDisplayTransformation;
            IEnvelope envelope = new Envelope() as IEnvelope;

            envelope.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                               (double)rectangle_0.Bottom);
            tagRECT tagRECT;

            tagRECT.left   = rectangle_0.Left;
            tagRECT.right  = rectangle_0.Right;
            tagRECT.bottom = rectangle_0.Bottom;
            tagRECT.top    = rectangle_0.Top;
            displayTransformation.set_DeviceFrame(ref tagRECT);
            displayTransformation.Bounds = envelope;
            ISymbol symbol = object_0 as ISymbol;

            if (symbol != null)
            {
                symbol.SetupDC(int_0, displayTransformation);
                if (symbol is IMarkerSymbol)
                {
                    this.method_3((IMarkerSymbol)symbol, rectangle_0);
                }
                else if (symbol is ILineSymbol)
                {
                    this.method_4((ILineSymbol)symbol, rectangle_0);
                }
                else if (symbol is IFillSymbol)
                {
                    this.method_5((IFillSymbol)symbol, rectangle_0);
                }
                symbol.ResetDC();
            }
        }
Exemplo n.º 2
0
        public static ITransformation CreateTransformationFromHDC(IntPtr HDC, int width, int height)
        {
            IEnvelope env = new Envelope() as IEnvelope;

            env.PutCoords(0, 0, width, height);
            tagRECT frame = new tagRECT();

            frame.left   = 0;
            frame.top    = 0;
            frame.right  = width;
            frame.bottom = height;
            double dpi  = Graphics.FromHdc(HDC).DpiY;
            long   lDpi = (long)dpi;

            if (lDpi == 0)
            {
                System.Windows.Forms.MessageBox.Show("获取设备比例尺失败!");
                return(null);
            }
            IDisplayTransformation dispTrans = new DisplayTransformation() as IDisplayTransformation;

            dispTrans.Bounds        = env;
            dispTrans.VisibleBounds = env;
            dispTrans.set_DeviceFrame(ref frame);
            dispTrans.Resolution = dpi;
            return(dispTrans);
        }
Exemplo n.º 3
0
        public void Draw1(int int_0, Rectangle rectangle_0, double double_0, double double_1)
        {
            IDisplayTransformation displayTransformation = new DisplayTransformation() as IDisplayTransformation;
            IEnvelope envelope = new Envelope() as ESRI.ArcGIS.Geometry.IEnvelope;

            envelope.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                               (double)rectangle_0.Bottom);
            tagRECT tagRECT;

            tagRECT.left   = rectangle_0.Left;
            tagRECT.right  = rectangle_0.Right;
            tagRECT.bottom = rectangle_0.Bottom;
            tagRECT.top    = rectangle_0.Top;
            displayTransformation.set_DeviceFrame(ref tagRECT);
            displayTransformation.Bounds         = envelope;
            displayTransformation.Resolution     = 72.0;
            displayTransformation.ReferenceScale = 1.0;
            displayTransformation.ScaleRatio     = 1.0;
            IPoint point = new ESRI.ArcGIS.Geometry.Point();

            point.X = (double)((rectangle_0.Left + rectangle_0.Right) / 2);
            point.Y = (double)((rectangle_0.Bottom + rectangle_0.Top) / 2);
            ISymbol symbol = this.m_pStyle as ISymbol;

            symbol.SetupDC(int_0, displayTransformation);
            symbol.Draw(point);
            symbol.ResetDC();
        }
Exemplo n.º 4
0
        public static ITransformation CreateTransformationFromHDC(IntPtr HDC, int width, int height)
        {
            ITransformation transformation;
            IEnvelope       envelopeClass = new Envelope() as IEnvelope;

            envelopeClass.PutCoords(0, 0, (double)width, (double)height);
            tagRECT _tagRECT = new tagRECT()
            {
                left   = 0,
                top    = 0,
                right  = width,
                bottom = height
            };
            double dpiY = (double)Graphics.FromHdc(HDC).DpiY;

            if ((long)dpiY != (long)0)
            {
                IDisplayTransformation displayTransformationClass =
                    new DisplayTransformation() as IDisplayTransformation;
                displayTransformationClass.Bounds        = envelopeClass;
                displayTransformationClass.VisibleBounds = envelopeClass;
                displayTransformationClass.set_DeviceFrame(ref _tagRECT);
                displayTransformationClass.Resolution = dpiY;

                transformation = displayTransformationClass;
            }
            else
            {
                MessageBoxHelper.ShowMessageBox("获取设备比例尺失败");
                transformation = null;
            }
            return(transformation);
        }
Exemplo n.º 5
0
        protected void DrawSymbol(int int_1, Rectangle rectangle_0, object object_0)
        {
            IDisplayTransformation displayTransformation = new DisplayTransformation() as IDisplayTransformation;
            IEnvelope envelope = new Envelope() as ESRI.ArcGIS.Geometry.IEnvelope;

            envelope.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                               (double)rectangle_0.Bottom);
            tagRECT tagRECT;

            tagRECT.left   = rectangle_0.Left;
            tagRECT.right  = rectangle_0.Right;
            tagRECT.bottom = rectangle_0.Bottom;
            tagRECT.top    = rectangle_0.Top;
            displayTransformation.set_DeviceFrame(ref tagRECT);
            displayTransformation.Bounds = envelope;
            ISymbol symbol = object_0 as ISymbol;

            if (symbol != null)
            {
                if (object_0 is IMarkerSymbol)
                {
                    IStyleGalleryClass styleGalleryClass = new MarkerSymbolStyleGalleryClass();
                    tagRECT            tagRECT2          = default(tagRECT);
                    tagRECT2.left   = rectangle_0.Left;
                    tagRECT2.right  = rectangle_0.Right;
                    tagRECT2.top    = rectangle_0.Top;
                    tagRECT2.bottom = rectangle_0.Bottom;
                    styleGalleryClass.Preview(object_0, int_1, ref tagRECT2);
                }
                else if (object_0 is ILineSymbol)
                {
                    IStyleGalleryClass styleGalleryClass = new LineSymbolStyleGalleryClass();
                    tagRECT            tagRECT2          = default(tagRECT);
                    tagRECT2.left   = rectangle_0.Left;
                    tagRECT2.right  = rectangle_0.Right;
                    tagRECT2.top    = rectangle_0.Top;
                    tagRECT2.bottom = rectangle_0.Bottom;
                    styleGalleryClass.Preview(object_0, int_1, ref tagRECT2);
                }
                else if (object_0 is IFillSymbol)
                {
                    IStyleGalleryClass styleGalleryClass = new FillSymbolStyleGalleryClass();
                    tagRECT            tagRECT2          = default(tagRECT);
                    tagRECT2.left   = rectangle_0.Left;
                    tagRECT2.right  = rectangle_0.Right;
                    tagRECT2.top    = rectangle_0.Top;
                    tagRECT2.bottom = rectangle_0.Bottom;
                    styleGalleryClass.Preview(object_0, int_1, ref tagRECT2);
                }
            }
        }
Exemplo n.º 6
0
 public override void Draw(int int_0, Rectangle rectangle_0, double double_0, double double_1)
 {
     if (this.m_pStyle is ISymbol3D)
     {
         IDisplayTransformation displayTransformation = new DisplayTransformation() as IDisplayTransformation;
         IEnvelope envelope = new Envelope() as IEnvelope;
         envelope.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                            (double)rectangle_0.Bottom);
         tagRECT tagRECT;
         tagRECT.left   = rectangle_0.Left;
         tagRECT.right  = rectangle_0.Right;
         tagRECT.bottom = rectangle_0.Bottom;
         tagRECT.top    = rectangle_0.Top;
         displayTransformation.set_DeviceFrame(ref tagRECT);
         displayTransformation.Bounds         = envelope;
         displayTransformation.Resolution     = 48.0;
         displayTransformation.ReferenceScale = 1.0;
         displayTransformation.ScaleRatio     = double_1;
         ISymbol symbol = this.m_pStyle as ISymbol;
         symbol.SetupDC(int_0, displayTransformation);
         object           value           = System.Reflection.Missing.Value;
         IPoint           point           = new ESRI.ArcGIS.Geometry.Point();
         IPointCollection pointCollection = new Polygon();
         point.PutCoords((double)(rectangle_0.Left + 3), (double)(rectangle_0.Top + 6));
         pointCollection.AddPoint(point, ref value, ref value);
         point.PutCoords((double)(rectangle_0.Right - 3), (double)(rectangle_0.Top + 6));
         pointCollection.AddPoint(point, ref value, ref value);
         point.PutCoords((double)(rectangle_0.Right - 3), (double)(rectangle_0.Bottom - 6));
         pointCollection.AddPoint(point, ref value, ref value);
         point.PutCoords((double)(rectangle_0.Left + 3), (double)(rectangle_0.Bottom - 6));
         pointCollection.AddPoint(point, ref value, ref value);
         point.PutCoords((double)(rectangle_0.Left + 3), (double)(rectangle_0.Top + 6));
         pointCollection.AddPoint(point, ref value, ref value);
         symbol.Draw((IGeometry)pointCollection);
         symbol.ResetDC();
     }
     else
     {
         IStyleGalleryClass styleGalleryClass = new FillSymbolStyleGalleryClass();
         tagRECT            tagRECT           = default(tagRECT);
         tagRECT.left   = rectangle_0.Left;
         tagRECT.right  = rectangle_0.Right;
         tagRECT.top    = rectangle_0.Top;
         tagRECT.bottom = rectangle_0.Bottom;
         styleGalleryClass.Preview(this.m_pStyle, int_0, ref tagRECT);
     }
 }
Exemplo n.º 7
0
        protected void DrawColorRamp(int int_0, Rectangle rectangle_0, IColorRamp icolorRamp_0)
        {
            IDisplayTransformation displayTransformation = new DisplayTransformation() as IDisplayTransformation;
            IEnvelope envelope = new Envelope() as IEnvelope;

            envelope.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                               (double)rectangle_0.Bottom);
            tagRECT tagRECT;

            tagRECT.left   = rectangle_0.Left;
            tagRECT.right  = rectangle_0.Right;
            tagRECT.bottom = rectangle_0.Bottom;
            tagRECT.top    = rectangle_0.Top;
            displayTransformation.set_DeviceFrame(ref tagRECT);
            displayTransformation.Bounds = envelope;
            IGradientFillSymbol gradientFillSymbol = new GradientFillSymbol();
            ILineSymbol         outline            = gradientFillSymbol.Outline;

            outline.Width = 0.0;
            gradientFillSymbol.Outline            = outline;
            gradientFillSymbol.ColorRamp          = icolorRamp_0;
            gradientFillSymbol.GradientAngle      = 180.0;
            gradientFillSymbol.GradientPercentage = 1.0;
            gradientFillSymbol.IntervalCount      = 100;
            gradientFillSymbol.Style = esriGradientFillStyle.esriGFSLinear;
            ISymbol symbol = (ISymbol)gradientFillSymbol;

            symbol.SetupDC(int_0, displayTransformation);
            object           value           = System.Reflection.Missing.Value;
            IPoint           point           = new ESRI.ArcGIS.Geometry.Point();
            IPointCollection pointCollection = new Polygon();

            point.PutCoords((double)(rectangle_0.Left + 3), (double)(rectangle_0.Top + 3));
            pointCollection.AddPoint(point, ref value, ref value);
            point.PutCoords((double)(rectangle_0.Right - 3), (double)(rectangle_0.Top + 3));
            pointCollection.AddPoint(point, ref value, ref value);
            point.PutCoords((double)(rectangle_0.Right - 3), (double)(rectangle_0.Bottom - 3));
            pointCollection.AddPoint(point, ref value, ref value);
            point.PutCoords((double)(rectangle_0.Left + 3), (double)(rectangle_0.Bottom - 3));
            pointCollection.AddPoint(point, ref value, ref value);
            point.PutCoords((double)(rectangle_0.Left + 3), (double)(rectangle_0.Top + 3));
            pointCollection.AddPoint(point, ref value, ref value);
            symbol.Draw((IGeometry)pointCollection);
            symbol.ResetDC();
        }
Exemplo n.º 8
0
        public void Draw2(int int_0, Rectangle rectangle_0, double double_0, double double_1)
        {
            IDisplayTransformation displayTransformation = new DisplayTransformation() as IDisplayTransformation;
            IEnvelope envelope = new Envelope() as ESRI.ArcGIS.Geometry.IEnvelope;

            envelope.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                               (double)rectangle_0.Bottom);
            tagRECT tagRECT;

            tagRECT.left   = rectangle_0.Left;
            tagRECT.right  = rectangle_0.Right;
            tagRECT.bottom = rectangle_0.Bottom;
            tagRECT.top    = rectangle_0.Top;
            displayTransformation.set_DeviceFrame(ref tagRECT);
            displayTransformation.Bounds         = envelope;
            displayTransformation.Resolution     = 72.0;
            displayTransformation.ReferenceScale = 1.0;
            displayTransformation.ScaleRatio     = 1.0;
            IPoint point = new ESRI.ArcGIS.Geometry.Point();

            point.X = (double)((rectangle_0.Left + rectangle_0.Right) / 2);
            point.Y = (double)((rectangle_0.Bottom + rectangle_0.Top) / 2);
            ISymbol symbol = this.m_pStyle as ISymbol;

            symbol.SetupDC(int_0, displayTransformation);
            ISimpleTextSymbol simpleTextSymbol = (ISimpleTextSymbol)symbol;
            string            text             = simpleTextSymbol.Text;
            bool clip = simpleTextSymbol.Clip;

            if (text.Length == 0)
            {
                simpleTextSymbol.Text = "AaBbYyZz";
            }
            simpleTextSymbol.Clip = true;
            symbol.Draw(point);
            simpleTextSymbol.Text = text;
            simpleTextSymbol.Clip = clip;
            symbol.ResetDC();
        }
Exemplo n.º 9
0
        private void method_0(int int_0, Rectangle rectangle_0, double double_0, double double_1)
        {
            IDisplayTransformation displayTransformation = new DisplayTransformation() as IDisplayTransformation;
            IEnvelope envelope = new Envelope() as IEnvelope;

            envelope.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                               (double)rectangle_0.Bottom);
            tagRECT tagRECT;

            tagRECT.left   = rectangle_0.Left;
            tagRECT.right  = rectangle_0.Right;
            tagRECT.bottom = rectangle_0.Bottom;
            tagRECT.top    = rectangle_0.Top;
            displayTransformation.set_DeviceFrame(ref tagRECT);
            displayTransformation.Bounds         = envelope;
            displayTransformation.Resolution     = double_0;
            displayTransformation.ReferenceScale = 1.0;
            displayTransformation.ScaleRatio     = double_1;
            ISymbol symbol = this.m_pStyle as ISymbol;

            symbol.SetupDC(int_0, displayTransformation);
            if (symbol is IPictureLineSymbol)
            {
                if (((IPictureLineSymbol)symbol).Picture == null)
                {
                    return;
                }
            }
            else if (symbol is IMarkerLineSymbol || symbol is IHashLineSymbol)
            {
                ITemplate template = ((ILineProperties)symbol).Template;
                if (template != null)
                {
                    bool flag = false;
                    int  i    = 0;
                    while (i < template.PatternElementCount)
                    {
                        double num;
                        double num2;
                        template.GetPatternElement(i, out num, out num2);
                        if (num + num2 <= 0.0)
                        {
                            i++;
                        }
                        else
                        {
                            flag = true;
IL_140:
                            if (flag)
                            {
                                object           value           = System.Reflection.Missing.Value;
                                IPointCollection pointCollection = new Polyline();
                                IPoint           point           = new ESRI.ArcGIS.Geometry.Point();
                                if (this.bool_0)
                                {
                                    point.PutCoords((double)(rectangle_0.Left + 2), (double)(rectangle_0.Bottom + 2));
                                    pointCollection.AddPoint(point, ref value, ref value);
                                    point.PutCoords((double)((rectangle_0.Width - 4) / 3 + rectangle_0.Left + 2),
                                                    (double)(rectangle_0.Top - 2));
                                    pointCollection.AddPoint(point, ref value, ref value);
                                    point.PutCoords((double)((rectangle_0.Width - 4) / 3 * 2 + rectangle_0.Left + 2),
                                                    (double)(rectangle_0.Bottom + 2));
                                    pointCollection.AddPoint(point, ref value, ref value);
                                    point.PutCoords((double)(rectangle_0.Right - 2), (double)(rectangle_0.Top - 2));
                                    pointCollection.AddPoint(point, ref value, ref value);
                                }
                                else
                                {
                                    point.PutCoords((double)(rectangle_0.Left + 3),
                                                    (double)((rectangle_0.Bottom + rectangle_0.Top) / 2));
                                    pointCollection.AddPoint(point, ref value, ref value);
                                    point.PutCoords((double)(rectangle_0.Right - 3),
                                                    (double)((rectangle_0.Bottom + rectangle_0.Top) / 2));
                                    pointCollection.AddPoint(point, ref value, ref value);
                                }
                                symbol.Draw((IGeometry)pointCollection);
                                symbol.ResetDC();
                            }
                            return;
                        }
                    }
                    ;
                }
            }
        }
Exemplo n.º 10
0
        protected void DrawSymbol(int int_0, Rectangle rectangle_0, object object_1)
        {
            IDisplayTransformation displayTransformation = new DisplayTransformation() as IDisplayTransformation;
            IEnvelope envelope = new Envelope() as ESRI.ArcGIS.Geometry.IEnvelope;

            envelope.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                               (double)rectangle_0.Bottom);
            tagRECT tagRECT;

            tagRECT.left   = rectangle_0.Left;
            tagRECT.right  = rectangle_0.Right;
            tagRECT.bottom = rectangle_0.Bottom;
            tagRECT.top    = rectangle_0.Top;
            displayTransformation.set_DeviceFrame(ref tagRECT);
            displayTransformation.Bounds = envelope;
            if (this.double_0 < 1.0 && object_1 is ILineSymbol)
            {
                displayTransformation.Resolution = 48.0 / this.double_0;
            }
            else
            {
                displayTransformation.Resolution = 96.0;
            }
            displayTransformation.ReferenceScale = 1.0;
            displayTransformation.ScaleRatio     = this.double_0;
            if (object_1 is IMarkerSymbol)
            {
                IStyleGalleryClass styleGalleryClass = new MarkerSymbolStyleGalleryClass();
                tagRECT            tagRECT2          = default(tagRECT);
                tagRECT2.left   = rectangle_0.Left;
                tagRECT2.right  = rectangle_0.Right;
                tagRECT2.top    = rectangle_0.Top;
                tagRECT2.bottom = rectangle_0.Bottom;
                styleGalleryClass.Preview(object_1, int_0, ref tagRECT2);
            }
            else if (object_1 is ILineSymbol)
            {
                IStyleGalleryClass styleGalleryClass = new LineSymbolStyleGalleryClass();
                tagRECT            tagRECT2          = default(tagRECT);
                tagRECT2.left   = rectangle_0.Left;
                tagRECT2.right  = rectangle_0.Right;
                tagRECT2.top    = rectangle_0.Top;
                tagRECT2.bottom = rectangle_0.Bottom;
                styleGalleryClass.Preview(object_1, int_0, ref tagRECT2);
            }
            else if (object_1 is IFillSymbol)
            {
                IStyleGalleryClass styleGalleryClass = new FillSymbolStyleGalleryClass();
                tagRECT            tagRECT2          = default(tagRECT);
                tagRECT2.left   = rectangle_0.Left;
                tagRECT2.right  = rectangle_0.Right;
                tagRECT2.top    = rectangle_0.Top;
                tagRECT2.bottom = rectangle_0.Bottom;
                styleGalleryClass.Preview(object_1, int_0, ref tagRECT2);
            }
            else
            {
                ISymbol symbol;
                if (object_1 is IColorRamp)
                {
                    IGradientFillSymbol gradientFillSymbol = new GradientFillSymbol();
                    ILineSymbol         outline            = gradientFillSymbol.Outline;
                    outline.Width = 0.0;
                    gradientFillSymbol.Outline            = outline;
                    gradientFillSymbol.ColorRamp          = (IColorRamp)object_1;
                    gradientFillSymbol.GradientAngle      = 180.0;
                    gradientFillSymbol.GradientPercentage = 1.0;
                    gradientFillSymbol.IntervalCount      = 100;
                    gradientFillSymbol.Style = esriGradientFillStyle.esriGFSLinear;
                    symbol = (ISymbol)gradientFillSymbol;
                }
                else if (object_1 is IColor)
                {
                    symbol = (ISymbol) new ColorSymbol
                    {
                        Color = (IColor)object_1
                    };
                }
                else if (object_1 is IAreaPatch)
                {
                    symbol = new SimpleFillSymbol() as ISymbol;
                    IRgbColor rgbColor = new RgbColor();
                    rgbColor.Red   = 227;
                    rgbColor.Green = 236;
                    rgbColor.Blue  = 19;
                    ((IFillSymbol)symbol).Color = rgbColor;
                }
                else if (object_1 is ILinePatch)
                {
                    symbol = new SimpleLineSymbol() as ISymbol;
                }
                else
                {
                    if (object_1 is INorthArrow)
                    {
                        IStyleGalleryClass styleGalleryClass = new NorthArrowStyleGalleryClass();
                        tagRECT            tagRECT2          = default(tagRECT);
                        tagRECT2.left   = rectangle_0.Left;
                        tagRECT2.right  = rectangle_0.Right;
                        tagRECT2.top    = rectangle_0.Top;
                        tagRECT2.bottom = rectangle_0.Bottom;
                        styleGalleryClass.Preview(object_1, int_0, ref tagRECT2);
                        return;
                    }
                    if (object_1 is ILegendItem)
                    {
                        IStyleGalleryClass styleGalleryClass = new LegendItemStyleGalleryClass();
                        tagRECT            tagRECT2          = default(tagRECT);
                        tagRECT2.left   = rectangle_0.Left;
                        tagRECT2.right  = rectangle_0.Right;
                        tagRECT2.top    = rectangle_0.Top;
                        tagRECT2.bottom = rectangle_0.Bottom;
                        styleGalleryClass.Preview(object_1, int_0, ref tagRECT2);
                        return;
                    }
                    if (object_1 is ILabelStyle)
                    {
                        IStyleGalleryClass styleGalleryClass = new LabelStyleGalleryClass();
                        tagRECT            tagRECT2          = default(tagRECT);
                        tagRECT2.left   = rectangle_0.Left;
                        tagRECT2.right  = rectangle_0.Right;
                        tagRECT2.top    = rectangle_0.Top;
                        tagRECT2.bottom = rectangle_0.Bottom;
                        styleGalleryClass.Preview(object_1, int_0, ref tagRECT2);
                        return;
                    }
                    if (object_1 is IMapSurround)
                    {
                        MapSurroundDraw mapSurroundDraw = new MapSurroundDraw(object_1 as IMapSurround);
                        mapSurroundDraw.Draw(int_0, rectangle_0, 96.0, this.double_0);
                        return;
                    }
                    if (object_1 is IBackground)
                    {
                        IDisplay display = new ScreenDisplay();
                        display.StartDrawing(int_0, 0);
                        display.DisplayTransformation = displayTransformation;
                        IGeometry geometry = ((IBackground)object_1).GetGeometry(display, envelope);
                        ((IBackground)object_1).Draw(display, geometry);
                        display.FinishDrawing();
                        return;
                    }
                    if (object_1 is IShadow)
                    {
                        ShadowDraw shadowDraw = new ShadowDraw(object_1 as IShadow);
                        shadowDraw.Draw(int_0, rectangle_0, 96.0, this.double_0);
                        return;
                    }
                    if (object_1 is IRepresentationMarker)
                    {
                        RepresentationMarkerDraw representationMarkerDraw =
                            new RepresentationMarkerDraw(object_1 as IRepresentationMarker);
                        representationMarkerDraw.Draw(int_0, rectangle_0, 96.0, this.double_0);
                        return;
                    }
                    if (object_1 is IRepresentationRuleItem)
                    {
                        try
                        {
                            RepresentationRuleDraw representationRuleDraw = new RepresentationRuleDraw(object_1);
                            IRepresentationRule    representationRule     =
                                (object_1 as IRepresentationRuleItem).RepresentationRule;
                            IBasicSymbol arg_61E_0 = representationRule.get_Layer(0);
                            representationRuleDraw.Draw(int_0, rectangle_0, 96.0, this.double_0);
                            return;
                        }
                        catch
                        {
                            return;
                        }
                    }
                    if (object_1 is IBorder)
                    {
                        IDisplay display = new ScreenDisplay();
                        display.StartDrawing(int_0, 0);
                        display.DisplayTransformation = displayTransformation;
                        IPointCollection pointCollection = new Polyline();
                        object           value           = System.Reflection.Missing.Value;
                        IPoint           point           = new ESRI.ArcGIS.Geometry.Point();
                        point.PutCoords((double)(rectangle_0.X + 4), (double)rectangle_0.Top);
                        pointCollection.AddPoint(point, ref value, ref value);
                        point.PutCoords((double)(rectangle_0.X + 4), (double)rectangle_0.Bottom);
                        pointCollection.AddPoint(point, ref value, ref value);
                        point.PutCoords((double)(rectangle_0.Right - 4), (double)rectangle_0.Bottom);
                        pointCollection.AddPoint(point, ref value, ref value);
                        IGeometry geometry = ((IBorder)object_1).GetGeometry(display, (IGeometry)pointCollection);
                        ((IBorder)object_1).Draw(display, geometry);
                        display.FinishDrawing();
                        return;
                    }
                    if (object_1 is IMapGrid)
                    {
                        IDisplay display = new ScreenDisplay();
                        display.StartDrawing(int_0, 0);
                        display.DisplayTransformation = displayTransformation;
                        IPointCollection pointCollection = new Polyline();
                        object           value           = System.Reflection.Missing.Value;
                        IPoint           point           = new ESRI.ArcGIS.Geometry.Point();
                        point.PutCoords((double)(rectangle_0.X + 4), (double)rectangle_0.Top);
                        pointCollection.AddPoint(point, ref value, ref value);
                        point.PutCoords((double)(rectangle_0.X + 4), (double)rectangle_0.Bottom);
                        pointCollection.AddPoint(point, ref value, ref value);
                        point.PutCoords((double)(rectangle_0.Right - 4), (double)rectangle_0.Bottom);
                        pointCollection.AddPoint(point, ref value, ref value);
                        IMapFrame mapFrame = new MapFrame() as IMapFrame;
                        IMap      map      = new Map();
                        mapFrame.Map = map;
                        (map as IActiveView).Extent = (pointCollection as IGeometry).Envelope;
                        (object_1 as IMapGrid).Draw(display, mapFrame);
                        display.FinishDrawing();
                        return;
                    }
                    return;
                }
                if (symbol is IPictureFillSymbol || symbol is IPictureLineSymbol)
                {
                    symbol.SetupDC(int_0, displayTransformation);
                }
                else
                {
                    symbol.SetupDC(int_0, displayTransformation);
                }
                if (symbol is IMarkerSymbol)
                {
                    this.method_0((IMarkerSymbol)symbol, rectangle_0);
                }
                else if (symbol is ILineSymbol)
                {
                    this.method_1((ILineSymbol)symbol, rectangle_0);
                }
                else if (symbol is IFillSymbol)
                {
                    this.method_2((IFillSymbol)symbol, rectangle_0);
                }
                else if (symbol is ITextSymbol)
                {
                    this.method_3((ITextSymbol)symbol, rectangle_0);
                }
                symbol.ResetDC();
            }
        }
Exemplo n.º 11
0
        public static void DrawSymbol(int int_0, Rectangle rectangle_0, object object_0, double double_0)
        {
            IDisplayTransformation displayTransformation = new DisplayTransformation() as IDisplayTransformation;
            IEnvelope envelope = new Envelope() as IEnvelope;

            envelope.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                               (double)rectangle_0.Bottom);
            tagRECT tagRECT;

            tagRECT.left   = rectangle_0.Left;
            tagRECT.right  = rectangle_0.Right;
            tagRECT.bottom = rectangle_0.Bottom;
            tagRECT.top    = rectangle_0.Top;
            displayTransformation.set_DeviceFrame(ref tagRECT);
            displayTransformation.Bounds = envelope;
            if (double_0 < 1.0 && object_0 is ILineSymbol)
            {
                displayTransformation.Resolution = 36.0 / double_0;
            }
            else
            {
                displayTransformation.Resolution = 72.0;
            }
            displayTransformation.ReferenceScale = 1.0;
            displayTransformation.ScaleRatio     = double_0;
            ISymbol symbol;

            if (object_0 is ISymbol)
            {
                symbol = (ISymbol)object_0;
            }
            else if (object_0 is IColorRamp)
            {
                IGradientFillSymbol gradientFillSymbol = new GradientFillSymbol();
                ILineSymbol         outline            = gradientFillSymbol.Outline;
                outline.Width = 0.0;
                gradientFillSymbol.Outline            = outline;
                gradientFillSymbol.ColorRamp          = (IColorRamp)object_0;
                gradientFillSymbol.GradientAngle      = 180.0;
                gradientFillSymbol.GradientPercentage = 1.0;
                gradientFillSymbol.IntervalCount      = 100;
                gradientFillSymbol.Style = esriGradientFillStyle.esriGFSLinear;
                symbol = (ISymbol)gradientFillSymbol;
            }
            else if (object_0 is IColor)
            {
                symbol = (ISymbol) new ColorSymbol
                {
                    Color = (IColor)object_0
                };
            }
            else if (object_0 is IAreaPatch)
            {
                symbol = new SimpleFillSymbol() as ISymbol;
                IRgbColor rgbColor = new RgbColor();
                rgbColor.Red   = 227;
                rgbColor.Green = 236;
                rgbColor.Blue  = 19;
                ((IFillSymbol)symbol).Color = rgbColor;
            }
            else if (object_0 is ILinePatch)
            {
                symbol = new SimpleLineSymbol() as ISymbol;
            }
            else
            {
                if (object_0 is INorthArrow)
                {
                    IDisplay display = new ScreenDisplay();
                    display.StartDrawing(int_0, 0);
                    display.DisplayTransformation = displayTransformation;
                    ((IMapSurround)object_0).Draw(display, null, envelope);
                    display.FinishDrawing();
                    return;
                }
                if (object_0 is IMapSurround)
                {
                    IDisplay display = new ScreenDisplay();
                    display.StartDrawing(int_0, 0);
                    display.DisplayTransformation = displayTransformation;
                    IEnvelope envelope2 = new Envelope() as IEnvelope;
                    envelope2.PutCoords((double)(rectangle_0.Left + 5), (double)(rectangle_0.Top + 5),
                                        (double)(rectangle_0.Right - 5), (double)(rectangle_0.Bottom - 5));
                    ((IMapSurround)object_0).Draw(display, null, envelope2);
                    display.FinishDrawing();
                    return;
                }
                if (object_0 is IBackground)
                {
                    IDisplay display = new ScreenDisplay();
                    display.StartDrawing(int_0, 0);
                    display.DisplayTransformation = displayTransformation;
                    IGeometry geometry = ((IBackground)object_0).GetGeometry(display, envelope);
                    ((IBackground)object_0).Draw(display, geometry);
                    display.FinishDrawing();
                    return;
                }
                if (object_0 is IShadow)
                {
                    IDisplay display = new ScreenDisplay();
                    display.StartDrawing(int_0, 0);
                    display.DisplayTransformation = displayTransformation;
                    IGeometry geometry = ((IShadow)object_0).GetGeometry(display, envelope);
                    ((IShadow)object_0).Draw(display, geometry);
                    display.FinishDrawing();
                    return;
                }
                if (object_0 is IBorder)
                {
                    IDisplay display = new ScreenDisplay();
                    display.StartDrawing(int_0, 0);
                    display.DisplayTransformation = displayTransformation;
                    IPointCollection pointCollection = new Polyline();
                    object           value           = System.Reflection.Missing.Value;
                    IPoint           point           = new ESRI.ArcGIS.Geometry.Point();
                    point.PutCoords((double)(rectangle_0.X + 4), (double)rectangle_0.Top);
                    pointCollection.AddPoint(point, ref value, ref value);
                    point.PutCoords((double)(rectangle_0.X + 4), (double)rectangle_0.Bottom);
                    pointCollection.AddPoint(point, ref value, ref value);
                    point.PutCoords((double)(rectangle_0.Right - 4), (double)rectangle_0.Bottom);
                    pointCollection.AddPoint(point, ref value, ref value);
                    IGeometry geometry = ((IBorder)object_0).GetGeometry(display, (IGeometry)pointCollection);
                    ((IBorder)object_0).Draw(display, geometry);
                    display.FinishDrawing();
                    return;
                }
                return;
            }
            if (symbol is IPictureFillSymbol || symbol is IPictureLineSymbol)
            {
                symbol.SetupDC(int_0, displayTransformation);
            }
            else
            {
                symbol.SetupDC(int_0, displayTransformation);
            }
            if (symbol is IMarkerSymbol)
            {
                SymbolDraw.DrawSymbol((IMarkerSymbol)symbol, rectangle_0);
            }
            else if (symbol is ILineSymbol)
            {
                SymbolDraw.DrawSymbol((ILineSymbol)symbol, rectangle_0, false);
            }
            else if (symbol is IFillSymbol)
            {
                SymbolDraw.DrawSymbol((IFillSymbol)symbol, rectangle_0);
            }
            else if (symbol is ITextSymbol)
            {
                SymbolDraw.DrawSymbol((ITextSymbol)symbol, rectangle_0);
            }
            symbol.ResetDC();
        }
Exemplo n.º 12
0
        public static void DrawSymbol(int int_0, Rectangle rectangle_0, object object_0, double double_0)
        {
            tagRECT   left = new tagRECT();
            ISymbol   object0;
            IDisplay  screenDisplayClass;
            IGeometry geometry;
            bool      flag;
            IDisplayTransformation displayTransformationClass = new DisplayTransformation() as IDisplayTransformation;
            IEnvelope envelopeClass = new Envelope() as IEnvelope;

            envelopeClass.PutCoords((double)rectangle_0.Left, (double)rectangle_0.Top, (double)rectangle_0.Right,
                                    (double)rectangle_0.Bottom);
            left.left   = rectangle_0.Left;
            left.right  = rectangle_0.Right;
            left.bottom = rectangle_0.Bottom;
            left.top    = rectangle_0.Top;
            displayTransformationClass.set_DeviceFrame(left);
            displayTransformationClass.Bounds = envelopeClass;
            if ((double_0 >= 1 ? true : !(object_0 is ILineSymbol)))
            {
                displayTransformationClass.Resolution = 72;
            }
            else
            {
                displayTransformationClass.Resolution = 36 / double_0;
            }
            displayTransformationClass.ReferenceScale = 1;
            displayTransformationClass.ScaleRatio     = double_0;
            if (object_0 is ISymbol)
            {
                object0 = (ISymbol)object_0;
            }
            else if (object_0 is IColorRamp)
            {
                IGradientFillSymbol gradientFillSymbolClass = new GradientFillSymbol();
                ILineSymbol         outline = gradientFillSymbolClass.Outline;
                outline.Width = 0;
                gradientFillSymbolClass.Outline            = outline;
                gradientFillSymbolClass.ColorRamp          = (IColorRamp)object_0;
                gradientFillSymbolClass.GradientAngle      = 180;
                gradientFillSymbolClass.GradientPercentage = 1;
                gradientFillSymbolClass.IntervalCount      = 100;
                gradientFillSymbolClass.Style = esriGradientFillStyle.esriGFSLinear;
                object0 = (ISymbol)gradientFillSymbolClass;
            }
            else if (object_0 is IColor)
            {
                object0 = (ISymbol)(new ColorSymbol()
                {
                    Color = (IColor)object_0
                });
            }
            else if (!(object_0 is IAreaPatch))
            {
                if (object_0 is ILinePatch)
                {
                    goto Label1;
                }
                if (object_0 is INorthArrow)
                {
                    screenDisplayClass = new ScreenDisplay();
                    screenDisplayClass.StartDrawing(int_0, 0);
                    screenDisplayClass.DisplayTransformation = displayTransformationClass;
                    ((IMapSurround)object_0).Draw(screenDisplayClass, null, envelopeClass);
                    screenDisplayClass.FinishDrawing();
                    return;
                }
                else if (object_0 is IMapSurround)
                {
                    screenDisplayClass = new ScreenDisplay();
                    screenDisplayClass.StartDrawing(int_0, 0);
                    screenDisplayClass.DisplayTransformation = displayTransformationClass;
                    IEnvelope envelope = new Envelope() as IEnvelope;
                    envelope.PutCoords((double)(rectangle_0.Left + 5), (double)(rectangle_0.Top + 5),
                                       (double)(rectangle_0.Right - 5), (double)(rectangle_0.Bottom - 5));
                    ((IMapSurround)object_0).Draw(screenDisplayClass, null, envelope);
                    screenDisplayClass.FinishDrawing();
                    return;
                }
                else if (object_0 is IBackground)
                {
                    screenDisplayClass = new ScreenDisplay();
                    screenDisplayClass.StartDrawing(int_0, 0);
                    screenDisplayClass.DisplayTransformation = displayTransformationClass;
                    geometry = ((IBackground)object_0).GetGeometry(screenDisplayClass, envelopeClass);
                    ((IBackground)object_0).Draw(screenDisplayClass, geometry);
                    screenDisplayClass.FinishDrawing();
                    return;
                }
                else if (object_0 is IShadow)
                {
                    screenDisplayClass = new ScreenDisplay();
                    screenDisplayClass.StartDrawing(int_0, 0);
                    screenDisplayClass.DisplayTransformation = displayTransformationClass;
                    geometry = ((IShadow)object_0).GetGeometry(screenDisplayClass, envelopeClass);
                    ((IShadow)object_0).Draw(screenDisplayClass, geometry);
                    screenDisplayClass.FinishDrawing();
                    return;
                }
                else if (object_0 is IBorder)
                {
                    screenDisplayClass = new ScreenDisplay();
                    screenDisplayClass.StartDrawing(int_0, 0);
                    screenDisplayClass.DisplayTransformation = displayTransformationClass;
                    IPointCollection polylineClass = new Polyline();
                    object           value         = Missing.Value;
                    IPoint           pointClass    = new ESRI.ArcGIS.Geometry.Point();
                    pointClass.PutCoords((double)(rectangle_0.X + 4), (double)rectangle_0.Top);
                    polylineClass.AddPoint(pointClass, ref value, ref value);
                    pointClass.PutCoords((double)(rectangle_0.X + 4), (double)rectangle_0.Bottom);
                    polylineClass.AddPoint(pointClass, ref value, ref value);
                    pointClass.PutCoords((double)(rectangle_0.Right - 4), (double)rectangle_0.Bottom);
                    polylineClass.AddPoint(pointClass, ref value, ref value);
                    geometry = ((IBorder)object_0).GetGeometry(screenDisplayClass, (IGeometry)polylineClass);
                    ((IBorder)object_0).Draw(screenDisplayClass, geometry);
                    screenDisplayClass.FinishDrawing();
                    return;
                }
                else
                {
                    return;
                }
            }
            else
            {
                object0 = new SimpleFillSymbol() as ISymbol;
                IRgbColor rgbColorClass = new RgbColor()
                {
                    Red   = 227,
                    Green = 236,
                    Blue  = 19
                };
                ((IFillSymbol)object0).Color = rgbColorClass;
            }
Label2:
            flag = (object0 is IPictureFillSymbol ? false : !(object0 is IPictureLineSymbol));
            if (flag)
            {
                object0.SetupDC(int_0, displayTransformationClass);
            }
            else
            {
                object0.SetupDC(int_0, displayTransformationClass);
            }
            if (object0 is IMarkerSymbol)
            {
                SymbolDraw.DrawSymbol((IMarkerSymbol)object0, rectangle_0);
            }
            else if (object0 is ILineSymbol)
            {
                SymbolDraw.DrawSymbol((ILineSymbol)object0, rectangle_0, false);
            }
            else if (object0 is IFillSymbol)
            {
                SymbolDraw.DrawSymbol((IFillSymbol)object0, rectangle_0);
            }
            else if (object0 is ITextSymbol)
            {
                SymbolDraw.DrawSymbol((ITextSymbol)object0, rectangle_0);
            }
            object0.ResetDC();
            return;

Label1:
            object0 = new SimpleLineSymbol() as ISymbol;
            goto Label2;
        }