C#,arcengine make Eagle Eye whole process (with annotation)

Source: Internet
Author: User
C # make Eagle Eye whole process (with annotation)

AxMapControl1 is the main control

To see the event response

1. Eagle Eye Map Resource Loading

private void Axmapcontrol1_onmapreplaced (object sender, Imapcontrolevents2_onmapreplacedevent e)

{

When the main map shows the control's map to be replaced, the map in the Eagle's eye follows the replacement

Axmapcontrol2.loadmxfile (Axmapcontrol1.documentfilename);

Axmapcontrol2.extent = axmapcontrol2.fullextent;

}

2. Draw the eagle eye rectangular frame

private void SetMap2 (Imapcontrolevents2_onextentupdatedevent e)

{

Get a new range

Ienvelope penv = (ienvelope) e.newenvelope;

Igraphicscontainer Pgra = Axmapcontrol2.map as Igraphicscontainer;

Iactiveview pAv = Pgra as Iactiveview;

Clears any graphic element in the AxMapControl2 before drawing

Pgra.deleteallelements ();

Irectangleelement Prectangleele = new Rectangleelementclass ();

IElement PEle = Prectangleele as ielement;

Pele.geometry = penv;

Set the Red Line box in the Eagle's eye chart

Irgbcolor Pcolor = new Rgbcolorclass ();

pcolor.red = 255;

Pcolor.green = 0;

Pcolor.blue = 0;

Pcolor.transparency = 255;

Produces a line symbol object

Ilinesymbol poutline = new Simplelinesymbolclass ();

Poutline.width = 2;

Poutline.color = Pcolor;

Set color Properties

Pcolor = new Rgbcolorclass ();

pcolor.red = 255;

Pcolor.green = 0;

Pcolor.blue = 0;

pcolor.transparency = 0;

Set the properties of a fill symbol

Ifillsymbol Pfillsymbol = new Simplefillsymbolclass ();

Pfillsymbol.color = Pcolor;

Pfillsymbol.outline = Poutline;

Ifillshapeelement Pfillshapeele = PEle as ifillshapeelement;

Pfillshapeele.symbol = Pfillsymbol;

Pgra.addelement ((ielement) pfillshapeele, 0);

Pav.partialrefresh (esriviewdrawphase.esriviewgraphics, NULL, NULL);

}

private void Axmapcontrol1_onextentupdated (object sender, Imapcontrolevents2_onextentupdatedevent e)

{

SETMAP2 (e);

}

3. Interactive

private void Axmapcontrol2_onmousedown (object sender, Imapcontrolevents2_onmousedownevent e)

{

by YL improved landgis@126.co

Irubberband Pband = new Rubberenvelopeclass ();

Igeometry pgeometry = pband.tracknew (AxMapControl2.ActiveView.ScreenDisplay, NULL);

if (pgeometry.isempty)

{

IPoint pPt = new Pointclass ();

Ppt.putcoords (E.MAPX, e.mapy);

Change the view scope of the main control

Axmapcontrol1.centerat (pPt);

}

Else

{

Axmapcontrol1.extent = Pgeometry.envelope;

AxMapControl1.ActiveView.Refresh ();

}

}


No money and ugly, rural hukou. Head can be broken, hairstyle must not be disorderly.
[Recently in Nanchang busy GIS hard ... ing]
Qq:14265545;83563956[10 year not last, or the forum message put]
Msn:qq14265545@hotmail.com
Come and see my blog sometime.
http://gisempire.com/blog/blog.asp?name=cl991036

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.