ArcObjects 类库(一)
---------------------------------------------------------------------------------------------------------
O0 ………… 在线帮助 & 本地帮助
OMD(对象模型图)
A1 ………… IWorkspaceFactory 接口
A2 ………… IWorkspace 接口
IFeatureWorkspace 接口
IWorkspaceEdit 接口
A3 ………… IFeatureClass 接口
A4 ………… IFeatureCursor 接口
A5 ………… IFeature 接口
A6 ………… IField 接口
IFieldEdit 接口
A7 ………… IFields 接口
IFieldsEdit 接口
A8 ………… IQueryFilter 接口
A9 ………… IGeoDataset 接口
Aa ………… IDataset 接口
G1 ………… ILayer 接口
G2 ………… IFeatureLayer 接口
IFeatureSelection 接口
ISelectionSet 接口
IEnumIDs 接口
G3 ………… IMap 接口
G4 ………… IMapDocument 接口
G5 ………… IGraphicsContainer 接口
G6 ………… IActiveView 接口
G7 ………… IFillShapeElement 接口
G8 ………… IElement 接口
G9 ………… IFrameProperties 接口
Ga ………… IMapFrame 接口
Gb ………… IMapGrid 接口
Gc ………… IMapGrids 接口
Gd ………… ISelectionEnvironment 接口
Ge ………… IPage 接口
Gf ………… ISnapGrid 接口
Gg ………… ISnapGuides 接口
Gh ………… IRulerSettings 接口
Gi ………… IGraphicsContainer 接口
Gj ………… IActiveView 接口
Gk ………… IFillShapeElement 接口
Gl ………… IElement 接口
Gm………… IElement 接口
Gn ………… IElement 接口
U1 ………… LicenseControl 控件
U2 ………… MapControl 控件
U3 ………… IMapControl2 接口
U4 ………… IMapControl3 接口
U5 ………… IMapControlEvents2 接口
U6 ………… PageLayoutControl 控件
U7 ………… IPageLayoutControl 接口
U8 ………… IPageLayoutControlEvents 控件
U9 ………… ToolbarControl 控件
Ua ………… IToolbarControl2 接口
Ub ………… TOCControl 控件
Uc ………… ITOCControl 接口
ILegendGroup 接口
ILegendClass 接口
Ud ………… ITOCControlEvents 接口
Ue ………… IHookHelper 接口
Uf ………… SymbologyControl 控件
Ug ………… ISymbologyControl 接口
ISymbologyStyleClass 接口
Uh ………… ISymbologyControlEvents 接口
Ui ………… TOCControl 控件
Uj ………… ITOCControl 接口
Uk ………… ITOCControlEvents 接口
Ul ………… GlobeControl 接口
Um………… GlobeControl 接口
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第O0个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. 通过在线帮助和本地帮助可以得到相同的内容,但是本地帮助速度更快,但是在线帮组效果更好,下面的图示展示了如何将二者联系起来,因为二者的排版还是存在一定的差别的!
---------------------------------------------------------------------------------------------------------
1> AbstractClass:抽象类算一个超类,不能用来实例化一个对象,比如Line就是一个抽象类,其他的线是Line之上,Line给出了所有线的共同特性和方法。
符号:平面矩形,白色。
2> CoClass:这种类可以直接通过new方法实例化出一个对象。
符号:长方体,灰色。
3> Class:这种类不能直接new出一个对象,但是可以通过实例的属性得到或者通过某个方法生成一个对象。
符号:长方体,白色。
4> Association(关联):表示一个类的实例可以和几个其他类的实例相关联,比如一个Line Symbol对象只能和一个线对象相关。
符号:灰色的线。
5> Type Inheritance(继承):是一个类可以通过继承,得到其父类的属性和方法,比如Line这个超类之上可以有其他类型的特定线类。
符号:空心三角箭头。
6> Instantiation(实例化):是某个类的某个方法可以实例化其他类的实例,比如:IWorkspaceFactory类的OpenFromFile()方法可以实例化一个IFeatureWorkspace类的实例。
符号:虚线箭头。
7> Composition(组成):是一个强制的关系,是一个类的实例包含了其他的类的实例,比如一个points会包含很多个point,当这么多的point的生命周期没有结束,points对象就不能从内存中卸载掉。
符号:黑色菱形。
8> Inbounde Interface(入接口):封装了若干属性和方法。
符号:空心圆。
9> Outbound Interface(出接口):封装的事件,即对象支持哪些事件的触发。
符号:实心圆。
※ 参考:CoClass 和 Class 的区别1
※ 参考:CoClass 和 Class 的区别2
※ 参考:ArcObjects学习的重要工具 Object Model Diagrams
※ 参考:关于接口的理解
interface Iperson //接口
{
void xuexi();
}
interface Idustman : Iperson
{
void saodi();
}
interface Iprogramer : Idustman
{
void biancheng();
}
interface Imanager : Iprogramer
{
void guanji();
}
class Test : Imanager
{
public void xuexi()
{
}
public void saodi()
{
}
public void biancheng()
{
}
public void guanji()
{
}
}
class person //类
{
public void xuexi1()
{
}
}
class dustman : person
{
public void soadi1()
{
}
}
class programer : dustman
{
public void biancheng1()
{
}
}
class manager : programer
{
public void guanji1()
{
}
}
class Test2 : manager
{
}
private void Form1_Load(object sender, EventArgs e)
{
Iperson Person = new Test();
Person.xuexi();
Idustman Dustman = Person as Idustman;
Dustman.saodi();
Dustman.xuexi();
Iprogramer Programer = Dustman as Iprogramer;
Programer.biancheng();
Programer.xuexi();
Programer.saodi();
Imanager Manager = Programer as Imanager;
Manager.guanji();
Manager.biancheng();
Manager.xuexi();
Manager.saodi();
person p = new person();
p.xuexi1();
dustman d = p as dustman;
d.soadi1();
d.xuexi1();
programer pro = d as programer;
pro.soadi1();
pro.xuexi1();
pro.biancheng1();
manager m = pro as manager;
m.soadi1();
m.xuexi1();
m.biancheng1();
m.guanji1();
}
接口只需提供方法,但是不用提供解决的途径,解决的途径在相应的类中定义,一个类可以同时集成多个接口,这些接口可以没有任何关系,但是类只能继承一个类,这里就体现出接口的优势,不同的接口可以将类的方法有机的分离开,更好的实现管理!(@McDelfino拙见)
参考:
其中,Nest和Chicken 是聚合关系(Aggregation),既它们之间不共存。
Wings和Chicken是组合关系(Composition),它们共存,翅膀是鸡的一部分,鸡不在了翅膀也就没了。
Bird和Chicken是继承关系(Type Inheritance),鸡是鸟的一种。
Egg和Chicken是实例化关系(Instantiation),鸡蛋可以用鸡的方法来实例化,鸡下蛋实例化鸡蛋。
Bird是AbstractClass,不能实例化。
Chicken和Nest是CoClass,可以通过New关键字来实例化。
Egg和Wings是Class,可以通过其他实例的方法来实例化。
---------------------------------------------------------------------------------------------------------
1. 该类库提供了统一的接口来访问空间数据,使用频率非常高的接口 IFeatureClass、ITable、IQueryFilter 等接口都是位于该类库中。用户在打开要素类、打开表、查询数据、读取数据、更新数据时都需要引用此类库。下图描述了表格、要素类、字段等对象之间的关系。
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第A1个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Use IWorkspaceFactory when you need to create a new workspace, connect to an existing workspace or find information about a workspace.
2. 属性和方法:
属性和方法 | Description | |
---|---|---|
ContainsWorkspace | Indicates if parentDirectory contains a valid workspace, or is a valid file-system workspace. | |
Copy | Copies a workspace to the specified destination folder. | |
Create | Creates a new workspace specified by the directory, file name, and connection properties. | |
GetClassID | The class ID of the WorkspaceFactory. | |
GetWorkspaceName | Retrieves the workspace name of a workspace from the given list of file names. | |
IsWorkspace | True if the specified file identifies a workspace supported by the workspace factory. | |
Move | Moves a workspace to the specified destination folder. | |
Open | Opens the workspace specified by the connection properties. | |
OpenFromFile (string fileName, int hWnd) 返回值:IWorkspace |
Opens the workspace specified by the given file name. 参考:http://www.gisvip.com/blog/?action-viewthread-tid-2400 |
|
ReadConnectionPropertiesFromFile | The connection properties from the specified file. | |
WorkspaceDescription | A singular or plural description of the type of workspace the workspace factory opens/creates. | |
WorkspaceType | The type of workspace the workspace factory opens/creates. |
参考:http://www.3sfield.com/content.php?id=327
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第A2个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that have information about the workspace.
工作空间!
2. 属性和方法:
方法和属性 | Description | |
---|---|---|
ConnectionProperties | The connection properties of the workspace. | |
DatasetNames | The DatasetNames in the workspace. | |
Datasets | The datasets in the workspace. | |
ExecuteSQL | Executes the specified SQL statement. | |
Exists | Checks if the workspace exists. | |
IsDirectory | TRUE if the workspace is a file system directory. | |
PathName | The file system full path of the workspace. | |
Type | The Type of the Workspace. | |
WorkspaceFactory | The factory that created the workspace. |
---------------------------------------------------------------------------------------------------------
1. Provides access to members that create and open various types of datasets and other workspace level objects.
Description | ||
---|---|---|
CreateFeatureClass (string Name, IFields Fields, UID CLSID, UID EXTCLSID, esriFeatureType FeatureType, string ShapeFieldName, string ConfigKeyword) 返回值:IFeatureClass |
Creates a new standalone feature class under the workspace. 第一个参数:shp文件名 第二个参数:添加的 Fields 第三个参数:null 第四个参数:null 第五个参数:要素类型 第六个参数:图形列的名称 第七个参数:"" |
|
CreateFeatureDataset | Creates a new feature dataset. | |
CreateQueryDef | Create a query definition object. | |
CreateRelationshipClass | Creates a new relationship class. | |
CreateTable | Creates a new table. | |
OpenFeatureClass (string Name) 返回值:IFeatureClass |
Opens an existing feature class. 返回指定文件名的 FeatureClass。 |
|
OpenFeatureDataset | Opens an existing feature dataset. | |
OpenFeatureQuery | Opens a feature dataset containing a single feature class defined by the specified Query. | |
OpenRelationshipClass | Opens an existing relationship class. | |
OpenRelationshipQuery | The table of a relationship join query. | |
OpenTable | Opens an existing table. |
---------------------------------------------------------------------------------------------------------
1. Provides access to members that control Workspace Editing. Note: the IWorkspaceEdit interface has been superseded byIWorkspaceEdit2. Please consider using the more recent version.
Description | ||
---|---|---|
AbortEditOperation | Aborts an edit operation. | |
DisableUndoRedo | Disables Undo and Redo of edit operations. | |
EnableUndoRedo | Enables Undo and Redo of edit operations. | |
HasEdits | True if there are any completed edit operations that need to be saved . | |
HasRedos | True if there are any completed undos that can be redone. | |
HasUndos | True if there are any completed edit operations that can be undone. | |
IsBeingEdited | True if the workspace is being edited. | |
RedoEditOperation | Causes a Redo to be performed on the last undo. | |
StartEditing | Starts editing the workspace. | |
StartEditOperation | Begins an edit operation. | |
StopEditing | Stops editing the workspace. | |
StopEditOperation | Ends an edit operation. | |
UndoEditOperation | Causes an Undo to be performed on the last edit operation. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第A3个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. The IFeatureClass interface is the main interface for getting and setting properties of a feature class. For example, use the IFeatureClass interface to get the type of feature class, get a count of features that satisfy some query, or create a new feature in the feature class. The IFeatureClass interface inherits from the IObjectClass interface.
获取或设置要素的属性,要素类!
2. 属性和方法:
方法和属性 | Description | |
---|---|---|
AddField | Adds a field to this object class. | |
AddIndex | Adds an index to this object class. | |
AliasName | The alias name of the object class. | |
AreaField | The geometry area field. | |
CLSID | The GUID for the COM Class (CoClass) corresponding to instances of this object class. | |
CreateFeature 返回值:IFeature |
Create a new feature, with a system assigned object ID and null property values. | |
CreateFeatureBuffer | Create a feature buffer that can be used with an insert cursor. | |
DeleteField | Deletes a field from this object class. | |
DeleteIndex | Deletes an index from this object class. | |
EXTCLSID | The GUID for the COM Class (CoClass) corresponding to the class extension for this object class. | |
Extension | The extension for this object class. | |
ExtensionProperties | The extension properties for this object class. | |
FeatureClassID | The unique ID for the Feature Class. | |
FeatureCount (IQueryFilter QueryFilter) |
The number of features selected by the specified query. 若是null,则选择全部~ |
|
FeatureDataset | The feature dataset that contains the feature class. | |
FeatureType | The type of features in this feature class. | |
Fields | The fields collection for this object class. | |
FindField | The index of the field with the specified name. | |
GetFeature (int ID) |
Get the feature with the specified object ID. 通过获取 FID 列的值来获取 IFeature!!! |
|
GetFeatures | Get a cursor of Rows given a set of object ids. | |
HasOID | Indicates if the class has an object identity (OID) field. | |
Indexes | The indexes collection for this object class. | |
Insert | Returns a cursor that can be used to insert new features. | |
LengthField | The geometry length field. | |
ObjectClassID | The unique ID for the object class. | |
OIDFieldName | The name of the field corresponding to the OID. | |
RelationshipClasses | The relationship classes in which this object class participates in for the specified role. | |
Search (IQueryFilter filter, bool Recycling) |
Returns an object cursor that can be used to fetch feature objects selected by the specified query. | |
Select | Returns a selection That contains the object ids selected by the specified query. | |
ShapeFieldName | The name of the default sShape field. | |
ShapeType | The type of the default Shape for the features in this feature class. | |
Update | Returns a cursor that can be used to update features selected by the specified query. |
※ 参考:http://www.3sfield.com/content.php?id=317
提取要素属性:
ILayer pLayer = axMapControl1.get_Layer(0); //获取图层
IFeatureLayer pFLayer = pLayer as IFeatureLayer; //获取矢量图层
IFeatureClass pFC = pFLayer.FeatureClass; //获取属性列表
IFeatureCursor pFCursor = pFC.Search(null, false); //访问要素
IFeature pFeature = pFCursor.NextFeature(); //获取单个要素
DataTable pTable = new DataTable();
DataColumn colName = new DataColumn("国家名");
colName.DataType = System.Type.GetType("System.String");
pTable.Columns.Add(colName);
DataColumn colArea = new DataColumn("洲名");
colArea.DataType = System.Type.GetType("System.String");
pTable.Columns.Add(colArea);
int indexOfName = pFC.FindField("NAME");
int indexOfName2 = pFC.FindField("REGION");
while (pFeature != null)
{
string name = pFeature.get_Value(indexOfName);
string area = pFeature.get_Value(indexOfName2);
DataRow pRow = pTable.NewRow();
pRow[0] = name;
pRow[1] = area;
pTable.Rows.Add(pRow);
pFeature = pFCursor.NextFeature();
}
dataGridView1.DataSource = pTable;
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第A4个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that hand out enumerated features, field collections and allows for the updating, deleting and inserting of features.
用来访问要素类中的一系列要素。
2. 属性和方法:
方法和属性 | Description | |
---|---|---|
DeleteFeature | Delete the existing Feature in the database corresponding to the current position of the cursor. | |
Fields | The fields Collection for this cursor. | |
FindField | The index of the field with the specified name. | |
Flush | Flush any outstanding buffered writes to the database. | |
InsertFeature | Insert a new Feature into the database using the property values in the input buffer. The ID of the new Feature is returned. | |
NextFeature | Advance the position of the cursor by one and return the Feature object at that position. | |
UpdateFeature | Update the existing Feature in the database corresponding to the current position of the cursor. |
※ 参考:http://blog.163.com/shuai686868@126/blog/static/203034612010102613814320/
※ 参考:http://www.3sfield.com/content.php?id=319
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第A5个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that return and set properties of a feature.
相当于每一个单独的要素,点、线或面!
2. 属性和方法:
方法和属性 | Description | |
---|---|---|
Class | The Object Class for the row. | |
Delete | Deletes the row. | |
Extent | The extent of the feature. | |
FeatureType | The type of the feature. | |
Fields | The fields Collection for this row buffer. | |
HasOID | Indicates if the row has an OID. | |
OID | The OID for the row. | |
Shape 返回值:IGeometry |
A reference to the default shape for the feature. | |
ShapeCopy 返回值:IGeometry |
A cloned copy of the default shape for the feature. 与上面的Shape,在我看来没有什么大的区别,可以获得要素的几何形体,以至于其envelope! |
|
Store | Stores the row. | |
Table | The Table for the row. | |
Value object get_Value(int Index); void set_Value(int Index, object Value); |
The value of the field with the specified index. 第一个参数:索引 第二个参数:值 获取要素某个字段的值、为要素的某个字段赋值! 通过“IFields.FindField("字段名称")”可以获取索引! |
※ 参考:http://www.3sfield.com/content.php?id=315
IFeature pFeature = pFeatureClass.CreateFeature(); pFeature.Shape = pPointColl as IPolygon; pFeature.Store(); pFeature.set_Value(pFeature.Fields.FindField(pColumns[2]), pBuildingList[i].Trim()); pFeature.Store();
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第A6个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that return information about the field. Note: the IField interface has been superseded byIField2. Please consider using the more recent version.
The field object represents a column in a table. A field has many properties, the most obvious ones being its name and its datatype. The esriFieldType enumeration lists the possible datatypes.
CoClasses and Classes | Description |
---|---|
Field | ESRI Field object. |
2. 属性和方法:
Description | ||
---|---|---|
AliasName | The alias name of the field. | |
CheckValue | Indicates if the value is valid given the field definition. | |
DefaultValue | The default value of the field. | |
Domain | The default domain of the field. | |
DomainFixed | Indicates if the field's domain is fixed. | |
Editable | Indicates if the field is editable. | |
GeometryDef | The geometry definition for the field if IsGeometry is TRUE. | |
IsNullable | Indicates if the field can contain null values. | |
Length | The maximum length, in bytes, for values described by the field. | |
Name | The name of the field. | |
Precision | The precision for field values. | |
Required | Indicates if the field is required. | |
Scale | The scale for field values. | |
Type 返回值:esriFieldType |
The type of the field. esriFieldType 枚举:int、long、Geometry、OID等 |
|
VarType | The VARTYPE of the field (e.g. VT_I4). |
---------------------------------------------------------------------------------------------------------
1. Provides access to members that edit the field properties including raster column definition.
Description | ||
---|---|---|
AliasName | The alias name of the field. | |
AliasName | The alias name of the field. | |
CheckValue | Indicates if the value is valid given the field definition. | |
DefaultValue | The default value of the field. | |
DefaultValue | The default value of the field. | |
Domain | The default domain of the field. | |
Domain | The default domain of the field. | |
DomainFixed | Indicates if the field's domain cannot be modified. | |
DomainFixed | Indicates if the field's domain is fixed. | |
Editable | Indicates if the field can be edited. This should always be set to true. | |
Editable | Indicates if the field is editable. | |
GeometryDef | The geometry definition for the field if IsGeometry is TRUE. | |
GeometryDef | The geometry definition if IsGeometry is TRUE. | |
IsNullable | Indicates if field values can be null. | |
IsNullable | Indicates if the field can contain null values. | |
Length | The maximum length, in bytes, for field values. | |
Length | The maximum length, in bytes, for values described by the field. | |
Name | The name of the field. | |
Name | The name of the field. | |
Precision | The precision for field values. | |
Precision | The precision for field values. | |
RasterDef | The raster column definition. | |
Required | Indicates if the field is required. | |
Required | Indicates if the field is required. | |
Scale | The scale for field values. | |
Scale | The scale for field values. | |
Type | The type for the field. | |
Type | The type of the field. | |
VarType | The VARTYPE of the field (e.g. VT_I4). |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第A7个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that return information about the fields. Note: the IFields interface has been superseded byIFields2. Please consider using the more recent version.
The Fields object represents a collection of columns in a table. The term field is synonymous with column. Each table in a database has an ordered collection of fields, there is always at least one field in a table. The ordered collection behaves like a list, so it is possible to access individual fields by a numbered position (or index) in the list.
CoClasses and Classes | Description |
---|---|
Fields | ESRI Fields object. |
2. 属性和方法:
Description | ||
---|---|---|
Field | The field at the specified index in the fields collection. | |
FieldCount | The number of fields in the fields collection. | |
FindField | Finds the index of the named field in the fields collection. | |
FindFieldByAliasName | Finds the index of the field with the alias name in the fields collection. |
① 将矢量数据的所有字段名称加到 comboBox1 中!
private void loadData()
{
ILayer pLayer = axMapControl1.get_Layer(0); //获取图层
IFeatureLayer pFLayer = pLayer as IFeatureLayer; //转换为矢量图层
IFeatureClass pFClass = pFLayer.FeatureClass; //获取图层表格数据
IFields pFields = pFClass.Fields; //获取字段集合
for (int i = 2; i < pFields.FieldCount;i++ ) //遍历字段
{
comboBox1.Items.Add(pFields.Field[i].Name); //获取每个字段的名称
}
comboBox1.Text = comboBox1.Items[2].ToString(); //设置默认显示
}
② 将矢量数据某个字段的全部 feature 值加入到 comboBox2 中!
private void loadFieldData()
{
comboBox2.Items.Clear(); //删除所有值
ILayer pLayer = axMapControl1.get_Layer(0); //获取图层
IFeatureLayer pFLayer = pLayer as IFeatureLayer; //转换为矢量图层
IFeatureClass pFClass = pFLayer.FeatureClass; //获取图层表格值
IFields pFields = pFClass.Fields; //获取所有字段
int Index = pFClass.FindField(comboBox1.Text); //找到列所在的 Index!
IFeatureCursor pFCursor = pFClass.Search(null, false); //用于循环null就是遍历全部
IFeature pFeature = pFCursor.NextFeature(); //用于获取每一个feature
while (pFeature != null)
{
string name = pFeature.get_Value(Index); //获取 Index 列的值!
comboBox2.Items.Add(name); //添加
pFeature = pFCursor.NextFeature(); //下一个要素
}
comboBox2.Text = comboBox2.Items[0].ToString(); //初始化
}
③ 在地图上选择特定的 feature!
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
axMapControl1.Map.ClearSelection(); //清除地图上的选择
axMapControl1.Refresh(esriViewDrawPhase.esriViewGeography, null, null); //刷新地图
ILayer pLayer = axMapControl1.get_Layer(0); //获取图层
IFeatureLayer pFLayer = pLayer as IFeatureLayer; //获取矢量图层
IFeatureClass pFC = pFLayer.FeatureClass; //获取属性
IQueryFilter pQFilter = new QueryFilter(); //新建查询
pQFilter.WhereClause = comboBox1.Text + "='" + comboBox2.Text + "'"; //查询内容
IFeatureCursor pFCursor = pFC.Search(pQFilter, false); //新建鼠标指针遍历
IFeature pFeature = null; //新建一个要素
pFeature = pFCursor.NextFeature(); //下一个要素
if (pFeature != null) //遍历
{
axMapControl1.Map.SelectFeature(axMapControl1.get_Layer(0), pFeature); //选择要素
axMapControl1.Refresh(esriViewDrawPhase.esriViewGraphicSelection, null, null); //刷新
}
}
---------------------------------------------------------------------------------------------------------
1. Provides access to members that modify a fields collection.
Description | ||
---|---|---|
AddField | Add a field to the fields collection. | |
DeleteAllFields | Delete all the fields from the fields collection. | |
DeleteField | Delete a field from the fields collection. | |
Field | The field at the specified index in the fields collection. | |
Field | The field at the specified position. | |
FieldCount | The number of fields in the fields collection. | |
FieldCount | The Number of fields in this field collection. | |
FindField | Finds the index of the named field in the fields collection. | |
FindFieldByAliasName | Finds the index of the field with the alias name in the fields collection. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第A8个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that filter data based on attribute values and or relationships.
IQueryFilter filters data based on an attribute query. A string defining a where clause is required. An optional list of columns may be included to specify the column values to be retrieved. If no columns are specified, all values will be returned.
CoClasses and Classes | Description |
---|---|
ImageQueryFilter (esriCarto) | An image query filter. |
QueryFilter | ESRI Query Filter object. |
SpatialFilter | ESRI Spatial Filter object. |
TemporalQueryFilter (esriTrackingAnalyst) | Controls properties for the temporal query filter. |
TimeQueryFilter (esriCarto) | TimeQueryFilter Class |
2. 属性和方法:
Description | ||
---|---|---|
AddField | Appends a single field name to the list of sub-fields. | |
OutputSpatialReference | The spatial reference in which to output geometry for a given field. | |
SubFields | The comma delimited list of field names for the filter. | |
WhereClause | The where clause for the filter 定义查询的语句。 |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第A9个 ╠══════════════════════════════════════════════════╣
╚════════╝
Description | ||
---|---|---|
Extent | The extent of the GeoDataset. 相当于 FullExtent 的作用! |
|
SpatialReference | The spatial reference of the GeoDataset. |
IFeatureLayer:对图层缩放显示!
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Aa个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that supply dataset information.
Description | ||
---|---|---|
BrowseName | The browse name of the dataset. | |
CanCopy | True if this dataset can be copied. | |
CanDelete | True if this dataset can be deleted. | |
CanRename | True if this dataset can be renamed. | |
Category | The category of the dataset. | |
Copy | Copies this dataset to a new dataset with the specified name. | |
Delete | Deletes this dataset. | |
FullName | The associated name object. | |
Name | The name of the Dataset. | |
PropertySet | The set of properties for the dataset. | |
Rename | Renames this Dataset. | |
Subsets | Datasets contained within this dataset. | |
Type | The type of the Dataset. | |
Workspace | The workspace containing this dataset. |
---------------------------------------------------------------------------------------------------------
1. Carto 类库中的对象负责创建地图、显示图层。使用频率比较高的 Imap、ILayer、IFeatureRenderer 都在 Carto 类库中,另外还包括地图元素 IElement 接口和子接口,例如:ILineElement、ITextElement 等。
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第G1个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. ILayer is a generic 【通用的、一般的】 interface for all layer objects. This interface has a method to draw the layer and provides access to generic layer properties.
各种图层的一个基类!
2. 属性和方法:
方法和属性 | Description | |
---|---|---|
AreaOfInterest | The default area of interest for the layer. | |
Cached | Indicates if the layer needs its own display cache. | |
Draw | Draws the layer to the specified display for the given draw phase. | |
MaximumScale | Maximum scale (representative fraction) at which the layer will display. | |
MinimumScale | Minimum scale (representative fraction) at which the layer will display. | |
Name | Layer name. | |
ShowTips | Indicates if the layer shows map tips. | |
SpatialReference | Spatial reference for the layer. | |
SupportedDrawPhases | Supported draw phases. | |
TipText | Map tip text at the specified location. | |
Valid | Indicates if the layer is currently valid. | |
Visible | Indicates if the layer is currently visible. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第G2个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to the properties and methods of a layer based on vector geographic data, which is typically a geodatabase, shapefile, or coverage feature class.
矢量图层,shapefile等!
FeatureLayer:CoClass。
2. 属性和方法:
方法和属性 | Description | |
---|---|---|
AreaOfInterest | The default area of interest for the layer. | |
Cached | Indicates if the layer needs its own display cache. | |
DataSourceType | Data source type. | |
DisplayField | Primary display field. | |
Draw | Draws the layer to the specified display for the given draw phase. | |
FeatureClass | The layer's feature class. 获取要素类! |
|
MaximumScale | Maximum scale (representative fraction) at which the layer will display. | |
MinimumScale | Minimum scale (representative fraction) at which the layer will display. | |
Name | Layer name. 显示在TOC上的名称。 |
|
ScaleSymbols | Indicates if symbols are scaled for the layer. | |
Search | Creates a cursor based upon the search criteria. | |
Selectable | Indicates if layer is selectable. 在框选的时候,该层的要素是否可以被选中! |
|
ShowTips | Indicates if the layer shows map tips. | |
SpatialReference | Spatial reference for the layer. | |
SupportedDrawPhases | Supported draw phases. | |
TipText | Map tip text at the specified location. | |
Valid | Indicates if the layer is currently valid. | |
Visible | Indicates if the layer is currently visible. 图层的复选框是否被选中! |
※ 参考:http://www.3sfield.com/content.php?id=321
插入矢量数据:
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "shapefile文件(*.shp)|*.shp";
ofd.InitialDirectory = @"F:\Desktop\Temp\ArcGIS_Data";
if (ofd.ShowDialog() != DialogResult.OK)
return;
FileInfo file = new FileInfo(ofd.FileName);
IWorkspaceFactory pWorkspaceFactory = new ShapefileWorkspaceFactory(); //工厂
IWorkspace pWorkspace = pWorkspaceFactory.OpenFromFile(file.DirectoryName, 0); //实例化工作空间
IFeatureWorkspace pFeatrueWorkspace = pWorkspace as IFeatureWorkspace; //实例化矢量工作空间
IFeatureClass pFC = pFeatrueWorkspace.OpenFeatureClass(file.Name); //实例化矢量要素类
IFeatureLayer pFLayer = new FeatureLayer(); //实例化矢量图层
pFLayer.FeatureClass = pFC; //建立连接
pFLayer.Name = pFC.AliasName; //命名
IMap pMap = axMapControl1.Map; //实例地图
pMap.AddLayer(pFLayer as ILayer); //增加图层
---------------------------------------------------------------------------------------------------------
1. Provides access to members that control feature selection.
获取选择集!
---------------------------------------------------------------------------------------------------------
1. Provides access to members that manage a set of selected table rows or features. Note: the ISelectionSet interface has been superseded byISelectionSet2. Please consider using the more recent version.
实例化选择集!
---------------------------------------------------------------------------------------------------------
1. Provides access to members that enumerate through IDs.
获取选择集中要素的 FID值 集合,依次可以获取选择的要素~
实现:缩放到所有选择要素
IEnvelope layerEnvelope = null; //实例化一个envelope IFeatureClass pFeatCls = pLayer.FeatureClass; IFeatureSelection selectLayer = pLayer as IFeatureSelection; //QI一个要素选择接口 ISelectionSet selectionSet = selectLayer.SelectionSet; //获取选择集 IEnumIDs enumIDs = selectionSet.IDs; //从选择集中获取FID值 IFeature feature; int i = 1; int iD = enumIDs.Next(); //读取第一个FID值 while (iD != -1) //-1 is reutned after the last valid ID has been reached { feature = pFeatCls.GetFeature(iD); //通过FID值获取要素 IEnvelope envelope = feature.ShapeCopy.Envelope; //获取要素的envelope if (i == 1) layerEnvelope = envelope; //先给layerEnvelope赋个值,否则后面没法用 else { layerEnvelope.Union(envelope); //其他情况就用union方法 } i++; iD = enumIDs.Next(); //遍历到下一个FID值,依次循环 } pMapControl.Extent = layerEnvelope; pMapControl.ActiveView.Refresh();
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第G3个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Use the IMap interface to display data from various data sources.
The IMap interface is a starting point for many of the tasks one does with a Map. For example, use IMap to add, delete, and access map layers containing data from various sources including feature layers and graphics layers; associate map surround objects (legends, scale bars, etc) with the Map; access the various properties of a Map including the area of interest, the current map units, and the spatial reference; select features and access the Map's current selection.
相当于一个地图框架。
Map:CoClass。
2. 属性和方法:
方法和属性 | Description | |
---|---|---|
ActiveGraphicsLayer | The active graphics layer. If no graphic layers exist a basic memory graphics layer will be created. | |
AddLayer | Adds a layer to the map. | |
AddLayers | Adds multiple layers to the map, arranging them nicely if specified. | |
AddMapSurround | Adds a map surround to the map. | |
AnnotationEngine | The annotation (label) engine the map will use. | |
AreaOfInterest | Area of interest for the map. | |
Barriers | The list of barriers and their weight for labeling. | |
BasicGraphicsLayer | The basic graphics layer. | |
ClearLayers | Removes all layers from the map. | |
ClearMapSurrounds | Removes all map surrounds from the map. | |
ClearSelection | Clears the map selection. | |
ClipBorder | An optional border drawn around ClipGeometry. | |
ClipGeometry | A shape that layers in the map are clipped to. | |
ComputeDistance | Computes the distance between two points on the map and returns the result. | |
CreateMapSurround | Create and initialize a map surround. An optional style from the style gallery may be specified. | |
DelayDrawing | Suspends drawing. | |
DelayEvents | Used to batch operations together to minimize notifications. | |
DeleteLayer | Deletes a layer from the map. | |
DeleteMapSurround | Deletes a map surround from the map. | |
Description | Description of the map. | |
DistanceUnits | The distance units for the map. | |
Expanded | Indicates if the Map is expanded. | |
FeatureSelection | The feature selection for the map. | |
GetPageSize | Gets the page size for the map. | |
IsFramed | Indicates if map is drawn in a frame rather than on the whole window. | |
Layer | The layer at the given index. | |
LayerCount | Number of layers in the map. | |
Layers | The layers in the map of the type specified in the uid. If recursive is true it will return layers in group layers. | |
MapScale | The scale of the map as a representative fraction. 设置和获取当前地图比例尺的属性。 |
|
MapSurround | The map surround at the given index. | |
MapSurroundCount | Number of map surrounds associated with the map. | |
MapUnits | The units for the map. | |
MoveLayer | Moves a layer to another position. | |
Name | Name of the map. | |
RecalcFullExtent | Forces the full extent to be recalculated. | |
ReferenceScale | The reference scale of the map as a representative fraction. 设置参考比例尺,若为“0”,则取消参考比例尺! |
|
SelectByShape (IGeometry Shape, ISelectionEnvironment env, bool justone) |
Selects features in the map given a shape and a selection environment (optional).axMapControl1.Map.SelectByShape(geometry, null , false); |
|
SelectFeature (ILayer layer, IFeature feature) |
Selects a feature. 给定 图层 和 元素,选择图层中的该要素! private void SelecteFeatures(List<string> OIDList) { IFeatureClass pFeatureClass = pLayer.FeatureClass; string strID = string.Empty; string[] IDs = OIDList.ToArray(); for (int i = 0; i < IDs.Length;i++ ) { strID = IDs[i]; IFeature selectedFeature = pFeatureClass.GetFeature(Convert.ToInt32(strID)); pMap.SelectFeature(pLayer, selectedFeature); } pActiveView.Refresh(); } |
|
SelectionCount | Number of selected features. | |
SetPageSize | Sets the page size for the map (optional). | |
SpatialReference | The spatial reference of the map. | |
SpatialReferenceLocked | Indicates whether the spatial reference is prevented from being changed. | |
UseSymbolLevels | Indicates if the Map draws using symbol levels. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第G4个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the reading and writing of map document files.
The IMapDocument interface provides properties and methods for reading map document files (*.mxd, *mxt, *.pmf) and writing and saving changes to map document files (*.mxd). However, since it is not tied to the ArcMap application, application-specific functionality in the MapDocument will not be persisted. Examples of application specific functionality are toolbar settings, UI customizations, VBA projects, and ArcMap graphs. For desktop developers who need to use this functionality, the MxDocument interface located in the ArcMapUI library is a better choice.
相当于一个地图文件,包括多个地图框架,具有“打开”、“保存”和“另存为”的方法。
MapDocument:CoClass。
MxDocument:CoClass。
2. 属性和方法:
属性和方法 | Description | |
---|---|---|
ActiveView | The ActiveView of the map document. | |
Close | Close the map document. | |
DocumentFilename | The map document filename that the MapDocument coclass is linked to. | |
DocumentType | The type of map document currently loaded in the object. | |
DocumentVersion | Indicates if the version of the map document is compatible with the current version of software. | |
GetVersionInfo | Retrieve the detailed version information of the map document. | |
IsMapDocument | Indicates if the map document is a valid map document. | |
IsPasswordProtected | Indicates if the map document is protected by a passsword. | |
IsPresent | Indicates if the map document is present. | |
IsReadOnly | Indicates if the map document is read only. | |
IsRestricted | Indicates if the use of the map document is restricted to certain applications. | |
Layer | The Layer object at the specified index for the specified map. | |
Map 属性:Map [int mapIndex] 方法:get_Map (int mapIndex) 指不同的数据框,每一个数据框相当于一个 Map 。 |
The Map object at the specified index.axMapControl1.Map = mapDocument.Map[i]; |
|
MapCount | The number of Map objects contained within the map document. 数据框的个数,也就是 Map 的个数。 |
|
New | Creates and opens a new map document in preparation for the contents to be retrieve or updated. | |
Open (string sDocument, string bsPassword) |
Open the map document in preparation for the contents to be retrieve or updated.mapDocument.Open(ofd.FileName, "");
|
|
PageLayout | The PageLayout object. | |
Printer | The printer object. If no printer object is stored in the map document this returns NULL. | |
ReplaceContents | Replace the contents of the map document. | |
Save (bool bUseRelativePaths, bool bCreateThumnbail) |
Save the contents of the map document to the bound file.mapDocument.Save(true, true); |
|
SaveAs (string sDocument, bool bUseRelativePaths, bool bCreateThumnbail) |
Save the contents of the map document to the specified file name. 第一个参数:完整路径,包括名字在内,第二个参数:是否使用相对路径,第三个参数:是否生成缩略图,预览的时候可以显现! mapDocument.SaveAs(sfd.FileName, false, true); |
|
SetActiveView | Set the ActiveView content of the map document. | |
Thumbnail | The thumbnail stored in the map document. If this is empty E_FAIL is returned. | |
UsesRelativePaths | Indicates if the data in the map document is referenced using relative paths. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第G5个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the Graphics Container【容器】.
Objects which manage a collection of graphic elements implement this interface. For example, the PageLayout, Map, and FDOGraphicsLayer object all implement this interface to provide access to the graphic elements they manage.
The PageLayout object contains a collection of Element objects including, MapFrames, MapSurroundFrames, and GraphicElements such as the PictureElement, MarkerElement and LineElement. The members of this interface provide access to the Elements.
When using this interface to add elements to layer types that operate in a corrdinate system, such as FDOGraphicsLayer and CompositeGraphicsLayer, the elements must implement IGraphicElement.
CoClasses that implement IGraphicsContainer
CoClasses and Classes | Description |
---|---|
CompositeGraphicsLayer | A collection of graphics layers that behave like single layer. |
FDOGraphicsLayer | A collection of properties for an annotation layer (feature data object graphics layer). |
GlobeGraphicsLayer (esriGlobeCore) | The Globe Graphics Layer. |
GraphicsLayer3D (esri3DAnalyst) | A 3D Graphics Layer. |
GraphicsSubLayer | Graphic sublayer handed back by the composite graphics layer. |
Map | A container for the display and manipulation of map data. |
PageLayout | Page Layout class contains maps and map surrounds. |
2. 属性和方法:
Description | ||
---|---|---|
AddElement (IElement Element, int zorder) |
Add a new graphic element to the layer. zorder 大部分时候赋值为0. |
|
AddElements | Add new graphic elements to the layer. | |
BringForward | Move the specified elements one step closer to the top of the stack of elements. | |
BringToFront | Make the specified elements draw in front of all other elements. | |
DeleteAllElements | Delete all the elements. 删除地图上面的所有临时图形元素! |
|
DeleteElement (IElement Element) |
Delete the given element. | |
FindFrame (object frameObject) |
Find the frame that contains the specified object.IFrameProperties frameProperties = (IFrameProperties)axPageLayoutControl1.GraphicsContainer.FindFrame(axPageLayoutControl1.ActiveView.FocusMap); |
|
GetElementOrder | Private order object. Used to undo ordering operations. | |
LocateElements | Returns the elements at the given coordinate. | |
LocateElementsByEnvelope | Returns the elements inside the given envelope. | |
MoveElementFromGroup | Move the element from the group to the container. | |
MoveElementToGroup | Move the element from the container to the group. | |
Next | Returns the next graphic in the container. | |
PutElementOrder | Private order object. Used to undo ordering operations. | |
Reset | Reset internal cursor so that Next returns the first element. | |
SendBackward | Move the specified elements one step closer to the bottom of the stack of elements. | |
SendToBack | Make the specified elements draw behind all other elements. | |
UpdateElement | The graphic element's properties have changed. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第G6个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the active view - the main application window.
This interface manages the main application window in ArcMap and all drawing operations.
In ArcMap, two objects implement【实现】 this interface: PageLayout and Map. These two objects correspond to the two different views in ArcMap: layout and data view. Only one view can be active at a time and this is termed the active view. IMxDocument::ActiveView holds a reference to the current active view object (a Map or the PageLayout). For example, if the ArcMap application is in layout mode, IMxDocument::ActiveView returns an IActiveView reference to the PageLayout object. Alternatively, if the application is in data view, this propery returns a reference【参考】 to the focus map.
ArcMap has view commands which allow users to toggle【切换】 between layout view and data view. These commands appear on the View menu and on the scroll bar.
An ArcMap document can contain many Maps. Make sure you have the desired object when working with this interface. Otherwise, operations such as drawing may not be occurring in the application window as you expect. For example, a Map obtained through IMxDocument::Maps is not guaranteed to be the focus map. If you know you want a reference to the focus map, use IMxDocument::FocusMap. Similarly, if you know you want a reference to the page layout, use IMxDocument::PageLayout instead. You can change the document's active view by setting IMxDocument::ActiveView. Learn more by reading the help for this property.
CoClasses that implement IActiveView
CoClasses and Classes | Description |
---|---|
Globe (esriGlobeCore) | A container for the display and manipulation of data in the Globe. |
Map | A container for the display and manipulation of map data. |
PageLayout | Page Layout class contains maps and map surrounds. |
Scene (esri3DAnalyst) | A container for the display and manipulation of data. |
2. 属性和方法:
Description | ||
---|---|---|
Activate | Gives this view control of the specified window. | |
Clear | Empties the view contents. | |
ContentsChanged | Called by clients when view objects are modified. | |
Deactivate | Another view takes over the associated window. | |
Draw | Draws the view to the specified device context. | |
ExportFrame | The device rectangle to export. | |
Extent | The visible extent rectangle. | |
ExtentStack | The extent stack. | |
FocusMap | The map that tools and controls act on. | |
FullExtent | The full extent rectangle. | |
GetContextMenu | Called when a context menu should be displayed at the given xy location. Return menu that should be displayed. | |
GraphicsContainer | The active graphics container. | |
HitTestMap | Returns any maps present in the view at the given location. Return value may be zero if there are no maps or the coordinate is not over a map. | |
IsActive | Indicates if view is active or not. | |
IsMapActivated | Indicates if the focus map is activated. | |
OnMessage | Call from your application's message loop to enable automatic resizing and keyboard accelerators. | |
Output | Renders the view to the specified DC. | |
PartialRefresh (esriViewDrawPhase Phase, object Data, IEnvelope envelope) |
Draws the specified view phase. Use an envelope of zero to draw the entire phase. esriViewDrawPhase 枚举: 参考:http://www.gisall.com/html/63/34963-3334.html activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); |
|
PrinterChanged | Called by application when printer changes. | |
Refresh | Causes the entire view to draw. | |
ScreenCacheID | The screen cache ID that is used to draw the specified phase. | |
ScreenDisplay 返回值:IScreenDisplay |
The screen display used by the view. | |
Selection | The selection. | |
ShowRulers | Indicates if rulers are visible. | |
ShowScrollBars | Indicates if scrollbars are visible. | |
ShowSelection | Indicates if selection is visible. | |
TipText | The tip text to display at the given location. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第G7个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. IFillShapeElement is a generic interface implemented by all 2d elements (CircleElement, EllipseElement, PolygonElement, and RectangleElement).
Use this interface when you want to retrieve or set the fill symbol being used by one of the fill shape elements.
CoClasses and Classes | Description |
---|---|
CircleElement | The Graphic Element to display Circles. |
EllipseElement | The Graphic Element to display Ellipses. |
GeoEllipseElement (esriDefenseSolutions) | The graphic element to display GeoEllipses. |
GeoPolygonElement (esriDefenseSolutions) | The graphic element for displaying GeoPolygons. |
MultiPatchElement | The MultiPatch Graphics Element CoClass. |
PolygonElement | The Graphic Element to display polygons. |
RectangleElement | The Graphic Element to display rectangles. |
Text3DElement | The Text3D Graphics Element CoClass. |
2. 属性和方法:
Description | ||
---|---|---|
Symbol 返回值:IFillSymbol |
Fill symbol this element uses to draw itself. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第G8个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the Element.
CoClasses that implement IElement
CoClasses and Classes | Description |
---|---|
BmpPictureElement | The Graphic Element to display BMP Pictures. |
CircleElement | The Graphic Element to display Circles. |
DataGraphTElement (esriCartoUI) | A container for the display and manipulation of data graph graphic element on the ArcMap layout view. |
DisplacementLinkElement (esriEditorExt) | The Graphic Element to display adjustment links. |
EllipseElement | The Graphic Element to display Ellipses. |
EmfPictureElement | The Graphic Element to display Emf Pictures. |
FEGraphic (esriDefenseSolutions) | A cached graphic that symbolizes a point based military object (feature or force element). |
FrameElement | The Frame element to provide a neatline or background. |
GeoEllipseElement (esriDefenseSolutions) | The graphic element to display GeoEllipses. |
GeoPolygonElement (esriDefenseSolutions) | The graphic element for displaying GeoPolygons. |
GeoPolylineElement (esriDefenseSolutions) | The graphic element for displaying GeoPolylines. |
GifPictureElement | Graphic Element to display GIF Pictures. |
GroupElement | The Group Graphic Element to display a group of graphic elements. |
IdentityLinkElement (esriEditorExt) | The Graphic Element to display identity links. |
InkGraphic | Ink Graphic Object. |
Jp2PictureElement | Graphic Element to display JPEG2000 Pictures. |
JpgPictureElement | Graphic Element to display JPG Pictures. |
LineElement | The Graphic Element to display lines. |
MapFrame | A graphic element for displaying maps. |
MapSurroundFrame | A graphic element for displaying map surrounds. |
MarkerElement | The Graphic Element to display markers. |
MoleGroupElement (esriDefenseSolutions) | Mole Group Element Class. |
MultiPatchElement | The MultiPatch Graphics Element CoClass. |
OleFrame (esriArcMapUI) | The OLE frame. |
ParagraphTextElement | The Graphic Element to display text which flows into an area geometry. |
PictureElement | Picture Graphic Element. |
PMFTitleTextElement | The Graphic Element to display dynamic PMF titles. |
PngPictureElement | Graphic Element to display PNG Pictures. |
PolygonElement | The Graphic Element to display polygons. |
RectangleElement | The Graphic Element to display rectangles. 显示矩形的图形要素。 IElement element = new RectangleElement();
|
TableFrame (esriEditorExt) | Graphic Element to display table. |
TemporalChartElement (esriTrackingAnalystUI) | Controls elements of the temporal charts. |
Text3DElement | The Text3D Graphics Element CoClass. |
TextElement | The Graphic Element to display text. |
TifPictureElement | Graphic Element to display TIF Pictures. |
2. 属性和方法:
Description | ||
---|---|---|
Activate | Prepare to display graphic on screen. | |
Deactivate | ActiveView that graphics are displayed on is no longer visible. | |
Draw | Draws the element into the given display object. | |
Geometry | Shape of the element as a geometry. | |
HitTest | Indicates if the given x and y coordinates are contained by the element. | |
Locked | Indicates if the element is in a read-only state. | |
QueryBounds | Bounds of the element taking symbology into consideration. | |
QueryOutline | Bounds of the element taking symbology into consideration. | |
SelectionTracker | Selection tracker used by this element. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第G9个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the General properties for a frame.
CoClasses that implement IFrameProperties
CoClasses and Classes | Description |
---|---|
BmpPictureElement | The Graphic Element to display BMP Pictures. |
EmfPictureElement | The Graphic Element to display Emf Pictures. |
FrameElement | The Frame element to provide a neatline or background. |
GifPictureElement | Graphic Element to display GIF Pictures. |
GroupElement | The Group Graphic Element to display a group of graphic elements. |
Jp2PictureElement | Graphic Element to display JPEG2000 Pictures. |
JpgPictureElement | Graphic Element to display JPG Pictures. |
LocatorRectangle | A map locator rectangle. |
MapFrame | A graphic element for displaying maps. |
MapSurroundFrame | A graphic element for displaying map surrounds. |
OleFrame (esriArcMapUI) | The OLE frame. |
Page | The On Screen Page. |
ParagraphTextElement | The Graphic Element to display text which flows into an area geometry. |
PictureElement | Picture Graphic Element. |
PngPictureElement | Graphic Element to display PNG Pictures. |
TableFrame (esriEditorExt) | Graphic Element to display table. |
TemporalChartElement (esriTrackingAnalystUI) | Controls elements of the temporal charts. |
TifPictureElement | Graphic Element to display TIF Pictures. |
2. 属性和方法:
Description | ||
---|---|---|
Background | Frame background used by this element. | |
Border | Frame border used by this element. | |
Shadow | Frame shadow used by this element. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Ga个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to the members that control the map element object.
IMapFrame is the default interface for the MapFrame object. The main purpose of the interface is to give the developer access to the map object stored within the frame, and it's associated locator rectangles.
Interfaces | Description |
---|---|
IFrameElement | Provides access to members that control the Frame element object. |
CoClasses and Classes | Description |
---|---|
MapFrame | A graphic element for displaying maps. |
2. 属性和方法:
Description | ||
---|---|---|
AddLocatorRectangle | Add a new locator rectangle to the data frame. | |
Background | Frame background used by this element. | |
Border | Frame border used by this element. | |
Container | The frame's container. | |
CreateSurroundFrame | Returns the map surround frame element of the type given in clsid. An optional style object may be specified. | |
DraftMode | Indicates if this element is in draft mode, i.e., draws fast. | |
ExtentType | The way in which the map extent of the frame is specified. | |
LocatorRectangle | Returns the locator rectangle at the specified index. | |
LocatorRectangleCount | The number of locator rectangles. | |
Map | The associated map. | |
MapBounds | The bounds of the map displayed by the frame. | |
MapScale | The scale at which the map should be displayed. | |
Object | Object framed by this element. | |
RemoveAllLocatorRectangles | Remove all the locator rectangles from the data frame. | |
RemoveLocatorRectangle | Remove a locator rectangle from the data frame. | |
Thumbnail | Small bitmap representation of this element. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Gb个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control a map grid.
IMapGrid is the main interface for setting properties that apply to all other types of grids. There are four specific types of MapGrid that all implement the IMapGrid interface. They are: IMeasuredGrid , IGraticule , IndexGrid , and ICustomGridOverlay .
CoClasses and Classes | Description |
---|---|
CustomOverlayGrid | A custom map grid. |
Graticule | A map grid that divides the map with meridians and parallels. |
IndexGrid | A map grid that divides the map into a grid for indexing. |
MeasuredGrid | A map grid that divides the map into a grid of units in any coordinate system. |
MgrsGrid | The Military Grid Reference System (MGRS) object. |
2. 属性和方法:
Description | ||
---|---|---|
Border | The map grid border. | |
Draw | Draws the map grid for a map frame to the given display. | |
ExteriorWidth | The width (in display units) of the portion of the grid that is outside of the frame. | |
GenerateGraphics | Generates graphic elements corresponding to the grid lines and stores them in the specified graphics container. | |
LabelFormat | The label format for map grid labels. | |
LineSymbol | The symbol used to draw grid lines - null will draw no lines. | |
Name | The name of the map grid. | |
PrepareForOutput | Prepares the map grid for output to a device. | |
QueryLabelVisibility | Returns the visibility of the labels along all four sides of the map grid. | |
QuerySubTickVisibility | Returns the visibility of the subticks along all four sides of the map grid. | |
QueryTickVisibility | Returns the visibility of the ticks along all four sides of the map grid. | |
SetDefaults | Sets the properties of the map grid to default values. | |
SetLabelVisibility | Sets the visibility of the labels along all four sides of the map grid. | |
SetSubTickVisibility | Sets the visibility of the subticks along all four sides of the map grid. | |
SetTickVisibility | Sets the visibility of the ticks along all four sides of the map grid. | |
SubTickCount | The number of subticks to draw between the major ticks. | |
SubTickLength | The length of the subticks in points. | |
SubTickLineSymbol | The symbol used to draw the subtick lines. | |
TickLength | The length of the major ticks in points. | |
TickLineSymbol | The line symbol used to draw the major ticks. | |
TickMarkSymbol | The symbol used to draw tick marks at the grid interval intersections - null will draw no tick marks. | |
Visible | Indicates if the map grid is visible. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Gc个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the map grids in a data frame.
IMapGrids is implemented only by the MapFrame object, but it is not the default interface for that object (IMapFrame is the default). Use this interface when you want to retrieve or set the grids (sometimes known as graticules) displayed with a particular MapFrame. The Grids are used to provide reference information for the map.
CoClasses and Classes | Description |
---|---|
MapFrame | A graphic element for displaying maps. |
2. 属性和方法:
Description | ||
---|---|---|
AddMapGrid | Adds a map grid to the map frame. | |
ClearMapGrids | Clears all map grids from the map frame. | |
DeleteMapGrid | Deletes a map grid from the map frame. | |
MapGrid | The map grid at the specified index. | |
MapGridCount | The number of map grids associated with the map frame. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Gd个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the selection environment.
CoClasses and Classes | Description |
---|---|
SelectionEnvironment | Defines the feature selection environment. |
2. 属性和方法:
Description | ||
---|---|---|
AreaSearchDistance | Distance used for selecting areas by proximity. | |
AreaSelectionMethod | Selection method used for areas. | |
CombinationMethod | Combination method for the selection results. | |
DefaultColor | Default selection color. | |
LinearSearchDistance | Distance used for selecting lines by proximity. | |
LinearSelectionMethod | Selection method used for lines. | |
PointSearchDistance | Distance used for selecting points by proximity. | |
PointSelectionMethod | Selection method used for points. | |
SearchTolerance | Search tolerance in device units. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Ge个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the Page.
private void button2_Click(object sender, EventArgs e) { ColorDialog cd = new ColorDialog(); cd.ShowDialog(); IPage pPage = axPageLayoutControl1.PageLayout.Page; IRgbColor pColor = new RgbColor(); pColor.Red = cd.Color.R; pColor.Green = cd.Color.G; pColor.Blue = cd.Color.B; pPage.BackgroundColor = pColor; }
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Gf个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the Snapping grid.
private void button3_Click(object sender, EventArgs e) { ISnapGrid pSnapGrid = axPageLayoutControl1.PageLayout.SnapGrid; pSnapGrid.VerticalSpacing = .2; pSnapGrid.HorizontalSpacing = .1; pSnapGrid.IsVisible = true; axPageLayoutControl1.ActiveView.Refresh(); }
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Gg个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the Snapping guides.
private void button4_Click(object sender, EventArgs e) { ISnapGuides pSnapGuides = axPageLayoutControl1.PageLayout.HorizontalSnapGuides; for (int i = 0; i < 30;i++ ) { pSnapGuides.AddGuide(i); } pSnapGuides.AreVisible = true; ISnapGuides pSnapGuides2 = axPageLayoutControl1.PageLayout.VerticalSnapGuides; for (int i = 0; i < 20;i++ ) { pSnapGuides2.AddGuide(i); } pSnapGuides2.AreVisible = true; axPageLayoutControl1.ActiveView.Refresh(); }
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Gh个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control Ruler setup.
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Gh个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control Ruler setup.
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Gi 个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control Ruler setup.
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Gj 个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control Ruler setup.
---------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第U1个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. 用来给控件提供许可,并不现实在程序上。
2. Using the LicenseControl.
3. How to programmatically handle LicenseControl initialization failure.
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第U2个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. MapControl 控件封装了 Map 对象,并提供了其他的属性、方法和事件,用于管理控件的外观、显示属性和地图属性,管理、添加数据图层,装载地图文挡,显示、绘制跟踪图层。MapControl上存在着诸如 TrackRectangle 、TrackPolygon 、TrackLine 和 TrackCircle 等帮助方法,用于追踪或" 橡皮圈住( rubber banding )"显示上的几何图形( Shape )。VisibleRegion 属性可用于更改MapControl 显示区内的几何图形。MapControl 控件实现的主要接口有IMapControlDefault 、IMapControl2 、IMapControl3 、lMapConlrolEvents2 等
2. Using the MapControl.
3. How to get started with the MapControl property pages.
4. How to enable arrow key and mouse wheel navigation of the map display.
axMapControl1.KeyIntercept = (int)esriKeyIntercept.esriKeyInterceptArrowKeys;
axMapControl1.AutoKeyboardScrolling = true;
axMapControl1.AutoMouseWheel = true;
5. How to rotate the MapControl display.
6. How to drop data onto the MapControl. 从其他窗口拖拽数据!
7. Displaying MapTips in the MapControl.
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第U3个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. The IMapControl2 interface is a starting point for any tasks related to the MapControl, such as setting general appearance, setting map and display properties, adding and managing data layers and map documents, and drawing and tracking shapes.
2. 属性和方法:
属性和方法 | Description | |
---|---|---|
AboutBox | Displays a dialog of information about the MapControl. | |
ActiveView | The active view of the Map contained by the MapControl. | |
AddLayer (ILayer Layer, int toIndex) |
Adds a layer to the Map's collection of layers at the specified index position. | |
AddLayerFromFile (string lyrPath, int toIndex) |
Loads a layer file and adds it to the Map's collection of layers at the specified index position. 默认为 0,toIndex 限制所处涂层的位置! |
|
AddShapeFile (string Path, string fileName) |
Adds a shapefile as a layer to the Map. 添加 Shapefile 文件! |
|
Appearance | The appearance of the MapControl. | |
BackColor | Background color of the MapControl. | |
BorderStyle | The border style of the MapControl. | |
CenterAt | Moves the center of the MapControl to the specified location. 指的是以地理坐标为中心。 IPoint point = new ESRI.ArcGIS.Geometry.Point(); //定义点 |
|
CheckMxFile (string fileName) |
Checks the specified filename to see if it is a map document that can be loaded into the MapControl. 判断是否为 *.mxd 文件。 |
|
ClearLayers | Removes all layers from the Map. | |
CurrentTool | Current active tool for the MapControl. Set to nothing to clear the tool. | |
DeleteLayer (int index) |
Removes a Layer from the Map's collection of layers at the specified index position.for (int i = axMapControl1.LayerCount - 1; i >= 0;i--) |
|
DrawShape (IGeometry, ref object symbol) |
Draws a geometry shape on the MapControl. | |
DrawText (IGeometry pGeometry, string text, ref object pSymbol) |
Draws text along the supplied geometry. | |
Enabled | Indicates whether the MapControl can respond to user generated events. | |
Extent IEnvelope |
Current extent of the Map in map units. 对于相同地图来说,即使在不同的 MapControl 中,但是相同区域的长和宽都是相同的!通过这个特点,可以很容易的实现让两个 MapControl 显示相同哦内容! private void axMapControl1_OnExtentUpdated(object sender, IMapControlEvents2_OnExtentUpdatedEvent e) |
|
FlashShape (IGeometry pShape, int nFlashes, int flashInterval, object symbol) |
Flashes a shape on the MapControl, duration is in milliseconds. |
|
FromMapPoint | Converts a point on the Map (in map units) to device co-ordinates (typically pixels). | |
FullExtent | Rectangular shape that encloses all features of all layers in the Map. | |
hWnd | Handle to the window associated with the MapControl. | |
Layer 属性:Layer [int index] 方法:get_Layer (int index) |
Layer at the supplied index. | |
LayerCount | Number of layers in the Map. | |
LoadMxFile (string mxPath, object mapNmeOrIndex, object password) |
Loads the specified Map from the map document into the MapControl. The Map can be an index or a name, if it is not supplied the focus map is used. 加载 *.mxd 文件。(Type.Missing 默认值) axMapControl1.LoadMxFile(filePath, Type.Missing, Type.Missing); |
|
Map | The Map contained by the MapControl. | |
MapScale | Scale of the map as a representative fraction. | |
MapUnits | The geographical units of the map. | |
MouseIcon | Custom mouse icon used if MousePointer is 99. | |
MousePointer | The mouse pointer displayed over the MapControl. esriControlsMousePointer 枚举:鼠标的不同显示样式!(箭头小圆圈) axMapControl1.MousePointer = esriControlsMousePointer.esriPointerHourglass; |
|
MoveLayerTo (int fromIndex, int toIndex) |
Moves a layer within the Map's collection from its current index position to a new index position. 若向下移动,则其上的整体上移,若向上移动,则其下整体下移。 |
|
OleDropEnabled | Indicates if the MapControl will fire events when data is dragged over the control's window. | |
Pan | Tracks the mouse while panning the MapControl. 实现在 MapControl 上面漫游。 |
|
ReadMxMaps | Opens a map document specified by the supplied filename and reads the maps into an array object. | |
ReferenceScale | Reference scale of the Map as a representative fraction. | |
Refresh | Redraws the Map, optionally just redraw specified phases or envelope. | |
Rotation (double Rotation) |
Determines how many degrees the map display is rotated. 旋转的角度,相对于最初位置而言的!下面实现在 0 ° 和 180° 之间切换! if (axMapControl1.Rotation == 0) { axMapControl1.Rotation = 180; axMapControl1.ActiveView.Refresh(); } else { axMapControl1.Rotation = 0; axMapControl1.ActiveView.Refresh(); } |
|
ShowScrollbars | Indicates whether or not the Map's scrollbars are visible. | |
SpatialReference | Spatial reference of the Map. | |
ToMapPoint | Converts a point in device co-ordinates (typically pixels) to a point on the Map (in map units). | |
TrackCancel | The object used by the MapControl to check if drawing has been aborted. | |
TrackCircle | Rubber-bands【橡皮筋】 a circle on the MapControl. | |
TrackLine IGeometry |
Rubber-bands a polyline on the MapControl. 用鼠标在 MapControl 上画折线。 |
|
TrackPolygon | Rubber-bands a polygon on the MapControl.
画 Polyline & 画 Circle
int flag = 0; |
|
TrackRectangle IGeometry |
Rubber-bands a rectangle on the MapControl. 用鼠标在 MapControl 上拉出一个矩形。 |
|
VisibleRegion | The geometry specifying the visible region of the Map. |
KeyIntercept:A property that specifies interception of key strokes that are normally handled by the container. When intercepted the OnKeyDown and OnKeyUp events will be called. This value can be a combined bit mask of esriKeyIntercept enum values.
AutoKeyboardScrolling:Indicates whether keyboard scrolling is enabled.
AutoMouseWheel:Indicates whether the mouse wheel is enabled.
axMapControl1.KeyIntercept = (int)esriKeyIntercept.esriKeyInterceptArrowKeys; //接收方向键 axMapControl1.AutoKeyboardScrolling = true; //允许使用键盘 axMapControl1.AutoMouseWheel = false; //允许使用鼠标中建
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第U4个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. 属性和方法:
MessageBox.Show(axMapControl1.DocumentFilename);
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第U5个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to events that occur with interaction to the MapControl.
This is the main events interface for the MapControl. Generally there is no need to explicitly set event handlers, as most development environments will automatically provide event handlers.
2. 事件:
事件 | Description | |
---|---|---|
OnAfterDraw | Fires after the Map draws a specified view phase. |
|
OnAfterScreenDraw | Fires after the Map contained by the MapControl has finished drawing. 效果好像和 OnExtentUpdated 比较类似! 不同点就是 OnAfterScreenDraw 是在操作之后才触发,而 OnExtentUpdated 是只要有范围变化即会触发,因此用前者的时候消耗资源更少,特别是在 MapControl 和 PageLayoutControl 交互的时候表现的更明显! |
|
OnBeforeScreenDraw | Fires before the Map contained by the MapControl starts to draw. | |
OnDoubleClick | Fires when the user presses and releases the mouse button twice in quick succession. | |
OnExtentUpdated 参数:e (object displayTransformation, bool sizeChanged, object newEnvelope) |
Fires after the extent (visible bounds) of the MapControl is changed. 当 MapControl 的地图可视边界范围变化的时候触发! 其中 newEnvelope 指的是 鼠标画的区域,若是通过滚轮放大缩小,则指的是 当前屏幕的区域。 Envelope 的大小是指地图中矩形的相对大小,当放大地图的时候,虽然同样是 Extent,但是 Envelope 的 Width 和 Height 属性都会缩小,同样的大小的矩形,随着比例尺的大小不同,Envelope的属性也会发生变化! |
|
OnFullExtentUpdated | Fires after the full extent (bounds) of the MapControl has changed. 当地图的覆盖范围变化时触发,例如,往地图中新增加一个图层,其覆盖范围大于原图的范围。 |
|
OnKeyDown | Fires after a key is pressed on the keyboard. | |
OnKeyUp | Fires after a pressed key is released. | |
OnMapReplaced | Fires after the Map contained by the MapControl has been replaced. 当 MapControl 的 mxd 文件替换时候触发事件!【鹰眼】 |
|
OnMouseDown |
Fires when the user presses any mouse button while over the MapControl. 在 MapControl 上面点击鼠标上面任何一个键触发事件! e.button = 1 表示 左键。 e.button = 2 表示 右键。 e.button = 4 表示 中键。 e.x 表示 像素横坐标。 e.y 表示 像素纵坐标。 e.MapX 表示 地图横坐标。 e.MapY 表示 地图纵坐标。 label1.Text = "MapX:" + string.Format("{0:0.00000}", e.mapX).PadLeft(10) + "°"; |
|
OnMouseMove | Fires when the user moves the mouse over the MapControl. 当鼠标在 MapControl 上面漫游的时候触发! |
|
OnMouseUp | Fires when the user releases a mouse button while over the MapControl. | |
OnOleDrop | Fires when an OLE drop action occurs on the MapControl. | |
OnSelectionChanged | Fires when the current selection changes. | |
OnViewRefreshed | Fires when the view is refreshed before drawing occurs. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第U6个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. PageLayoutControl 控件主要用于页面布局与和制图。该控件封装了 PageLayout 类,提供了布局视图中控制元素的属性和方法,以及其他的事件、属性和方法。
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第U7个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the PageLayoutControl. Note: the IPageLayoutControl interface has been superseded byIPageLayoutControl3. Please consider using the more recent version.
The IPageLayoutControl interface is a starting point for any tasks related to the PageLayoutControl, such as setting general appearance, setting page and display properties, adding and finding elements, loading map documents, and printing.
CoClasses that implement IPageLayoutControl
CoClasses and Classes | Description |
---|---|
PageLayoutControl | ESRI PageLayoutControl |
2. 属性和方法:
Description | ||
---|---|---|
AboutBox | Displays a dialog of information about the PageLayoutControl. | |
ActiveView | The active view of the PageLayout contained by the PageLayoutControl. | |
AddElement | Adds the supplied element to the PageLayout, with optional geometry, symbolization, name and Z order. | |
Appearance | The appearance of the PageLayoutControl. | |
BackColor | Background color of the PageLayoutControl. | |
BorderStyle | The border style of the PageLayoutControl. | |
CenterAt | Moves the center of the PageLayoutControl to the specified location. | |
CheckMxFile | Checks the specified filename to see if it is a map document that can be loaded into the PageLayoutControl. | |
CurrentTool | Current active tool for the PageLayoutControl. Set to nothing to clear the tool. | |
Enabled | Indicates whether the PageLayoutControl can respond to user generated events. | |
Extent | Current extent of the PageLayout in page units. 此 Extent 所表示的是那个 Layout 的外框范围,所以外框放的越大,则 Extent 越小,这里的 Extent 与 MapControl 中的 Extent 没办法建立联系,因为所控制的东西不同! |
|
FindElementByName | Find the first element with the supplied name, supply an occurrence parameter to find the second, third and so on. | |
FromPagePoint | Converts a point on the page (in page units) to device co-ordinates (typically pixels). | |
FullExtent | Rectangular shape that encloses the PageLayout. | |
GraphicsContainer | The graphics container of the PageLayout object contained by the PageLayoutControl. | |
hWnd | Handle to the window associated with the PageLayoutControl. | |
LoadMxFile | Loads the specified map document into the PageLayout contained by the PageLayoutControl. | |
LocateFrontElement | Locates an element at the given page co-ordinates. If more than one element is at the location the element nearest the front is returned. | |
MouseIcon | Custom mouse icon used if MousePointer is 99. | |
MousePointer | The mouse pointer displayed over the PageLayoutControl. | |
OleDropEnabled | Indicates if the PageLayoutControl will fire events when data is dragged over the control's window. | |
Page | The Page associated with the PageLayout contained by the PageLayoutControl. | |
PageLayout | The PageLayout contained by the PageLayoutControl. | |
Pan | Tracks the mouse while panning the PageLayoutControl. | |
Printer | The printer object used by the PageLayoutControl for printing. | |
PrinterPageCount | The number of printer pages the PageLayout will cover. | |
PrintPageLayout | Sends the specified range of pages on the printer. | |
Refresh | Redraws the PageLayout, optionally just redraw specified phases or envelope. | |
ToPagePoint | Converts device co-ordinates (typically pixels) to a point on the page (in page units). | |
TrackCancel | The object used by the PageLayoutControl to check if drawing has been aborted. | |
TrackRectangle | Rubber-bands a rectangle on the PageLayoutControl. | |
ZoomToWholePage | Changes the extent of the PageLayout to show a whole page. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第U8个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to events that occur with user interaction to the PageLayoutControl.
CoClasses and Classes | Description |
---|---|
PageLayoutControl | ESRI PageLayoutControl |
PageLayoutControlEventsListener (esriSystemUtility) | Helper coclass to provide IPageLayoutControlEvents support to the C++ API. |
2. 属性和方法:
Description | ||
---|---|---|
OnAfterDraw | Fires after the PageLayoutControl draws a specified view phase. | |
OnAfterScreenDraw | Fires after the PageLayout contained by the PageLayoutControl has finished drawing. | |
OnBeforeScreenDraw | Fires before the PageLayout contained by the PageLayoutControl starts to draw. | |
OnDoubleClick | Fires when the user presses and releases the mouse button twice in quick succession. | |
OnExtentUpdated | Fires after the extent (visible bounds) of the PageLayoutControl is changed. | |
OnFocusMapChanged | Fires when the current focus map in the PageLayoutControl has been switched to a new map. | |
OnFullExtentUpdated | Fires after the full extent (bounds) of the PageLayoutControl has changed. | |
OnKeyDown | Fires after a key is pressed on the keyboard. | |
OnKeyUp | Fires after a pressed key is released. | |
OnMouseDown | Fires when the user presses any mouse button while over the PageLayoutControl. | |
OnMouseMove | Fires when the user moves the mouse pointer over the PageLayoutControl. | |
OnMouseUp | Fires when the user releases a mouse button while over the PageLayoutControl. | |
OnOleDrop | Fires when an OLE drop action occurs on the PageLayoutControl. | |
OnPageLayoutReplaced | Fires after the PageLayout object used by the PageLayoutControl has been replaced. | |
OnPageSizeChanged | Fires when the Page associated with the PageLayout has had its size changed. | |
OnViewRefreshed | Fires when the view is refreshed before drawing occurs. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第U9个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. ToolbarControl 包括6个对象及相关接口: ToolbarControl 、ToolbarItem 、ToolbarMenu 、CommandPool 、CustomizeDialog 、MissingCommand。ToolbarControl 要与一个"伙伴控件"协同工作。通过ToolbarControl 属性页设置,或者在驻留ToolbarControl 的容器被显示时用SetBuddyControl 方法通过编程设置。
ToolbarControl 的每个"伙伴控件"都实现了 IToolbarBuddy 接口,这个接口用于设置"伙伴控件"的 CurrentTool 属性。如通过设置 MapControl 作为其"伙伴控件",当用户单击该 ToolbarControl 上的"拉框放大" 工具时,该放大工具就会成为 MapControl 的 CurrentTool 。放大工具的实现过程是:通过ToolbarControl 获取其"伙伴控件",然后在 MapControl 上提供显示终端用户按动鼠标所画的框,并改变 MapControl 的显示范围。ToolbarControl 一般要与一个"伙伴控件"协同工作,并有一个控件命令选择集,以便快速提供功能强大的GIS 应用程序。ToolbarControl 不仅提供了部分用户界面,而且还提供了部分应用程序框架。ArcGIS Desktop 应用程序,如 ArcMap 、ArcGlobe 和 ArcScene 等具有强大而灵活的框架,包括诸如工具条、命令、菜单、泊靠窗口和状态条等用户界面组件,这些框架使终端用户可以通过改变位置、添加利删除这些用户界面组 件来定制应用程序。
ArcGIS Engine 提供了几套使用 ArcGIS 控件的命令,以便执行某种特定动作,开发人员可通过创建执行特定任务的定和l命令来扩展这套控件命令。所有的命令对象都实现了 ICommand 接口,ToolbarControl 在适当的时候要使用该接口来调用方法和访问属性。在命令对象被驻留到 ToolbarControl 后,就会立即调用 ICommand: :OnCreate 方法,这个方法将一个句柄(Handle) 或钩子(hook)传递给该命令操作的应用程序。命令的实现一般都要经过测试,以查看该钩子(hook)对象是否被支持.如果不支持则该钩子自动失效,如 果支持,命令则存储该钩子以便以后使用。ToolbarControl 使用钩子(hook) 来联系命令对象和..伙伴控件",并提供了属性、方法和事件用于管理控件的外观,设置伙伴控件,添加、删除命令项,设置当前工具等。 ToolbarControl 的主要接口有: IToolbarControl 、IToolbarControlDefault、IToolbarControlEvents。
(1) IToolbarControl: 该接口是任何与 ToolbarControl 有关的任务的出发点,如设置"伙伴控件"的外观,设置伙伴控件,添加或去除命令、工具、菜单等。
(2) ITooJbarControlDefault: 该接口是自动暴露的缺省的 dispatch 接口,该接口的属性和方法与 ToolbarControl 的最高版本主接口的属性、方法相同。例如目前版本中的 IToolbarControlDefault 等同于 IToolbarControl .但在今后的新版本中,可能会变为 IToolbarControl2 。在开发中使用 IToolbarControlDefault 接口,能够保证总是访问到最新版本的ToolbarControl。
(3) IToolbarControlEvents: 该接口是一个事件接口,定义了 ToolbarControl 能够处理的全部事件,如 OnDoubleClick、OnltemClick、OnKeyDown 等。
在ToolbarControl 上可以驻留以下3 类命令。
(1)实现了响应单击事件的 ICommand 接口的单击命令。用户单击事件, 会导致对 ICommand : :OnClick 方法的调用,并执行某种动作。通过改变ICommand: :Checked 属性的值,简单命令项的行为就像开关那样。单击命令是可以驻留在菜单中的惟一命令类型。
(2)实现了 ICommand 接口和 ITool 接口、需要终端用户与"伙伴控件"的显示进行交互的工具。ToolbarControl 维护 CurrentTool 属性。当终端用户单击ToolbarControl 上的工具时,该工具就成为 CurrentTool。ToolbarControl 会设置"伙伴控件"的 CurrentTool 属性。当某个工具为 CurrentTool 时,该工具会从"伙伴控件"收到鼠标和键盘事件。
(3)实现了 ICommand 接口和 IToolControl 接口的工具控件。这通常是用户界面组件。ToolbarControl 驻留了来自 ItoolControl: hWnd 属性窗口句柄提供的一个小窗口,只能向 ToolbarControl 添加特定工具控件的一个例程。
可以使用3 种方法向 ToolbarControl 添加命令,第1 种是指定唯一识别命令的一个UID ,第2 种是指定一个 progID,第3 种是给 AddToolbarDef 方法提供某个现有命令对象的一个例程。下面给出样例代码。
//Add a toolbardef by passing a UIO
UID uID = new UIDClass();
uID.Value = "esriControls.ControlsMapNavigationToolbar";
axToolbarControl1.AddToolbarDef(uID, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
//Add a toolbardef by passing a ProgID
string progID = "esriControls.ControlsMapNavigationToolbar";
axToolbarControl1.AddToolbarDef(progID, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
//Add a toolbardef by passing an IToolbarDef
IToolBarDef toolBarDef = new ControlsMapNavigationToolbarClass();
axToolbarControl1.AddToolbarDef(toolBarDef, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
ToolbarControl 更新命令的使用。默认情况下,ToolbarControl 每半秒钟自动更新一次,以确保驻留在 ToolbarControl 上的每个工具条命令项的外观与底层命令的 Enabled 、Bitmap 、Caption 等属性同步。改变 Updatelnterval 属性可以更改更新频率。Updatelnterval 为0会停止任何自动发生的更新,可以通过编程调用 Update 方法以刷新每个工具条命令项的状态。
在应用程序中首次调用 Update 方法时,ToolbarControl 会检查每个工具条命令项的底层命令的 ICommand: :OnCreate 方法是否已经被调用过,如果还没有调用过该方法,该 ToolbarCommand 将作为钩子被自动传递给 ICommand: :OnCreate 方法。
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Ua个 ╠══════════════════════════════════════════════════╣
╚════════╝
Member:
Description | ||
---|---|---|
AboutBox | Displays a dialog of information about the ToolbarControl. | |
AddItem | Adds an item to the ToolbarControl. 增加单个工具或是命令!或是 ToolPalette! |
|
AddMenuItem | Adds a menu item to the ToolbarControl. 增加菜单项! |
|
AddToolbarDef | Appends the contents of the toolbar definition, specified by Guid or ToolbarDef, to the toolbar control. | |
Appearance | The appearance of the ToolbarControl. | |
BorderStyle | The border style of the ToolbarControl. | |
Buddy | The object that will have its current tool managed by the toolbar. | |
CommandPool | The command pool used by the ToolbarControl to manage command objects. The command pool object maybe shared with other ToolbarControls and ToolbarMenus. | |
Count | The number of items on the ToolbarControl. | |
CurrentTool | The current tool of the buddy. | |
Customize | Indicates if the ToolbarControl is in customize mode. | |
CustomProperty | A property to associate data with a control. | |
Enabled | Indicates whether the ToolbarControl can respond to user generated events. | |
Find | Returns the index of the first item containing the given command, menu or palette. Returns -1 if the command is not found. | |
GetItem | Returns the item at the specified index from the ToolbarControl. | |
GetItemRect | Returns the dimensions of the item at the specified index. | |
HitTest | Returns the index of the item at the specified x and y coordinates. | |
hWnd | Handle to the window associated with the ToolbarControl. | |
ItemAppearance | The appearance of the items on the ToolbarControl. | |
KeyIntercept | A property that specifies interception of key strokes that are normally handled by the container. When intercepted the OnKeyDown and OnKeyUp events will be called. This value can be a combined bit mask of esriKeyIntercept enum values. | |
LargeIcons | Indicates if large icons are shown on all items on the ToolbarControl. | |
MenuTracking | Indicates if menu tracking is enabled on the ToolbarControl. | |
MouseIcon | Custom mouse icon used if MousePointer is 99. | |
MousePointer | The mouse pointer displayed over the ToolbarControl. | |
MoveItem | Moves an item from one index to another. | |
Object | A property that returns the underlying control. This can be used when the control is inside a wrapper object that has been added by a development environment. | |
OperationStack | The operation stack used for undo and redo functionality. If present commands can use it to store operations. | |
Remove | Removes the item at the specified index from the ToolbarControl. | |
RemoveAll | Removes all items from the ToolbarControl. | |
SetBuddyControl | Sets a control to be a buddy of the toolbar, this control must support IToolbarBuddy. | |
TextAlignment | The caption placement for all items on the ToolbarControl. | |
ToolTips | Indicates if the items tooltips are shown. | |
Update | Updates the enabled state of the specified item or all items if an index of -1 is specified. Specify fullUpdate to update the group, group spacing, style and bitmap properties. | |
UpdateInterval | The frequency in millisecs that update method is called on the ToolbarControl. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Ub个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. TOCControl 是用来管理图层的可见性和标签的编辑。TOCControl 需要一个"伙伴控件",或实现了IActiveView 接口的对象协同工作。"伙伴控件"可以是MapControl 、PageLayoutControl 、ReaderControl 、SceneControl 或GlobeControl。"伙伴控件" 可以通过TOCControl 属性页设置,或者在驻留TOCControl 的容器被显示时用SetBuddyControl 方法通过编程设置。TOCControl 的每个"伙伴控件"都实现了 ITOCBuddy 接口。TOCControl 用"伙伴控
件"来显示其地图、图层和符号体系内容的一个交互树视图,并保持其内容与"伙伴控件"同步。TOCControl 通过 ITOCBuddy 接口来访问其"伙伴控件" 。
TOCControl 的主要接口有两个,一个是 ITOCControl,一个是 ITOCControlEvents。ITOCControl 接口是任何与 TOCControl 有关的任务的出发点,如设置控件的外观、设置"伙伴控件" 、管理图层的可见性和标签的编籍等。ITOCControlEvents 是一个事件接口,它定义了 TOCControl 能够处理的全部事件,如OnMouseDown 、OnMouseMove 、OnMouseUp 等,这些事件在构建独立应用程序中经常使用,如 OnBeginLabelEdit 、OnEndLabelEdit 分别是TOCControl 中的标签开始编箱、结束编辑时触发。
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Uc个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the TOCControl. Note: the ITOCControl interface has been superseded byITOCControl2. Please consider using the more recent version.
The ITOCControl interface is a starting point for any tasks related to the TOCControl such as setting the general appearance, setting the Buddy control, and managing layer visibility and label editing.
CoClasses that implement ITOCControl
CoClasses and Classes | Description |
---|---|
TOCControl | ESRI TOCControl |
2. 属性和方法:
Description | ||
---|---|---|
AboutBox | Displays a dialog of information about the TOCControl. 显示此控件的一些信息!弹出窗口! |
|
ActiveView | The ActiveView used to populate the TOCControl. | |
Appearance | The appearance of the TOCControl. | |
BorderStyle | The border style of the TOCControl. | |
Buddy | The object whose ActiveView is used to populate the TOCControl. | |
CustomProperty | A property to associate data with a control. | |
Enabled | Indicates whether the TOCControl can respond to user generated events. | |
HitTest (int X, int Y, ref esriTOCControlItem ItemType, ref IBasicMap BasicMap, ref ILayer Layer, ref object Unk, ref object Data) |
Returns the item in the TOCControl at the specified coordinates. esriTOCControlItem 枚举:返回样式 IBasicMap:绑定 MapControl 的 IBasicMap 接口!返回地图框架 ILayer:被点击的图层!返回图层 Unk:TOCControl 的 LegendGroup 对象! Data:LegendClass 在 LegendGroup 中的 Index! private void axTOCControl1_OnMouseDown(object sender, ITOCControlEvents_OnMouseDownEvent e) { IBasicMap map = new MapClass(); ILayer layer = new FeatureLayerClass(); object other = new object(); object index = new object(); esriTOCControlItem item = new esriTOCControlItem(); axTOCControl1.HitTest(e.x, e.y, ref item, ref map, ref layer, ref other, ref index); if (e.button == 1) { ILegendClass legendClass = new LegendClassClass(); ISymbol symbol = null; if (other is ILegendGroup && (int)index != -1) //判断存在性 { legendClass = ((ILegendGroup)other).get_Class((int)index); //获取 legendClass symbol = legendClass.Symbol; //将自带的样式赋值给变量 } symbol = GetSymbolByControl(symbol); //函数通过窗口获取 symbol legendClass.Symbol = symbol; axMapControl1.Refresh(esriViewDrawPhase.esriViewGeography, null, null); } } |
|
hWnd | Handle to the window associated with the TOCControl. 返回一个 int 类型的值,唯一标示此控件,每次运行的时候生成值不同! |
|
KeyIntercept | A property that specifies interception of key strokes that are normally handled by the container. When intercepted the OnKeyDown and OnKeyUp events will be called. This value can be a combined bit mask of esriKeyIntercept enum values. | |
LabelEdit | Label editing state. | |
LayerVisibilityEdit | Layer visibility editing state. | |
MouseIcon | Custom mouse icon used if MousePointer is 99. | |
MousePointer | The mouse pointer displayed over the TOCControl. | |
Object | A property that returns the underlying control. This can be used when the control is inside a wrapper object that has been added by a development environment. | |
SetActiveView | Sets the ActiveView used to populate the TOCControl. | |
SetBuddyControl | Sets a control to be a buddy of the toolbar, this control must support ITOCBuddy. | |
Update | Updates the contents of the TOCControl to match its ActiveView. |
---------------------------------------------------------------------------------------------------------
1. Provides access to members that control the collection of legend classes provided by a renderer.
---------------------------------------------------------------------------------------------------------
1. Provides access to members that control the legend/TOC entry for a renderer class.
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Ud个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to events that occur with interaction to the TOCControl.
This is the main events interface for the TOCControl. Generally there is no need to explicitly set event handlers, as most development environments will automatically provide event handlers.
CoClasses and Classes | Description |
---|---|
TOCControl | ESRI TOCControl |
TOCControlEventsListener (esriSystemUtility) | Helper coclass to provide ITOCControlEvents support to the C++ API. |
2. 属性和方法:
Description | ||
---|---|---|
OnBeginLabelEdit | Fires when label editing begins. | |
OnDoubleClick | Fires when the user presses and releases the mouse button twice in quick succession. | |
OnEndLabelEdit | Fires when label editing ends. | |
OnKeyDown | Fires after a key is pressed on the keyboard. | |
OnKeyUp | Fires after a pressed key is released. | |
OnMouseDown | Fires when the user presses any mouse button while over the TOCControl. | |
OnMouseMove | Fires when the user moves the mouse pointer over the TOCControl. | |
OnMouseUp | Fires when the user releases a mouse button while over the TOCControl. |
实现 ArcMap 样子的图层移动:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) //加载地图
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "map document(*.mxd)|*.mxd";
ofd.ShowDialog();
axMapControl1.LoadMxFile(ofd.FileName,0,null);
TopMost = true;
}
ILayer moveLayer; //要移动的图层!
int mdY; //记录鼠标点击的位置中坐标!
bool isDown = false; //记录鼠标是否点击了!
int index; //记录移动到的图层的索引!
private void axTOCControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.ITOCControlEvents_OnMouseDownEvent e) //鼠标点击
{
esriTOCControlItem item = esriTOCControlItem.esriTOCControlItemNone;
IBasicMap map = null;
ILayer layer = null;
object Unk = null;
object Data = null;
axTOCControl1.HitTest(e.x, e.y,ref item,ref map,ref layer,ref Unk,ref Data);
moveLayer = layer; //获取要移动的图层
mdY = e.y;
panel1.Visible = true;
axTOCControl1.MousePointer = esriControlsMousePointer.esriPointerLabel;
isDown = true;
}
private void axTOCControl1_OnMouseUp(object sender, ITOCControlEvents_OnMouseUpEvent e) //鼠标松开
{
panel1.Visible = false;
axTOCControl1.MousePointer = esriControlsMousePointer.esriPointerDefault;
isDown = false;
esriTOCControlItem item = esriTOCControlItem.esriTOCControlItemNone;
IBasicMap map = null;
ILayer layer = null;
object Unk = null;
object Data = null;
axTOCControl1.HitTest(e.x, e.y, ref item, ref map, ref layer, ref Unk, ref Data);
IMap pMap = axMapControl1.ActiveView.FocusMap;
if (moveLayer != layer) //要是不是同一图层则实行移动
{
for (int i = 0; i < pMap.LayerCount;i++ )
{
if (layer == pMap.get_Layer(i))
{
index = i; //获取移动到图层的索引
}
}
pMap.MoveLayer(moveLayer, index);
}
axTOCControl1.Refresh();
}
private void axTOCControl1_OnMouseMove(object sender, ITOCControlEvents_OnMouseMoveEvent e) //鼠标移动
{
esriTOCControlItem item = esriTOCControlItem.esriTOCControlItemNone;
IBasicMap map = null;
ILayer layer = null;
object Unk = null;
object Data = null;
axTOCControl1.HitTest(e.x, e.y, ref item, ref map, ref layer, ref Unk, ref Data);
IMap pMap = axMapControl1.ActiveView.FocusMap;
if (e.y > mdY) //往下移动的时候,要插入到图层的下面
{
for (int i = 0; i < pMap.LayerCount;i++ )
{
if (layer == pMap.get_Layer(0))
panel1.Location = new System.Drawing.Point(50, 67);
else if (layer == pMap.get_Layer(1))
panel1.Location = new System.Drawing.Point(50, 103);
else if (layer == pMap.get_Layer(2))
panel1.Location = new System.Drawing.Point(50, 139);
else if (layer == pMap.get_Layer(3))
panel1.Location = new System.Drawing.Point(50, 175);
}
}
else //往上移动的时候,要插入到图层的上面
{
for (int i = 0; i < pMap.LayerCount; i++)
{
if (layer == pMap.get_Layer(0))
panel1.Location = new System.Drawing.Point(50, 31);
else if (layer == pMap.get_Layer(1))
panel1.Location = new System.Drawing.Point(50, 67);
else if (layer == pMap.get_Layer(2))
panel1.Location = new System.Drawing.Point(50, 103);
else if (layer == pMap.get_Layer(3))
panel1.Location = new System.Drawing.Point(50, 139);
}
}
if (isDown) //若处于鼠标点击状态,只有鼠标点击的时候才发生,普通状态不发生!
{
if (layer == moveLayer || (moveLayer == pMap.get_Layer(0) && e.y <= 31) || (moveLayer == pMap.get_Layer(3) && e.y >= 139))
{
axTOCControl1.MousePointer = esriControlsMousePointer.esriPointerNoDrop;
panel1.Visible = false;
}
else
{
axTOCControl1.MousePointer = esriControlsMousePointer.esriPointerLabel;
panel1.Visible = true;
}
}
}
}
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Ue个 ╠══════════════════════════════════════════════════╣
╚════════╝
可以实现控件之间的关联,传过去的 hook 会接收操作!
参考:http://gisfire.blog.163.com/blog/static/139077132201211942026566/
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Uf 个 ╠══════════════════════════════════════════════════╣
╚════════╝
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Ug个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to members that control the SymbologyControl.
The ISymbologyControl interface is a starting point for any tasks related to the SymbologyControl, such as setting general appearance, loading symbology from within server style files and setting the style class.
CoClasses and Classes | Description |
---|---|
SymbologyControl | Provides access to the ESRI SymbologyControl. |
2. 属性和方法:
Description | ||
---|---|---|
AboutBox | Displays a dialog of information about the SymbologyControl. | |
Appearance | The appearance of the SymbologyControl. | |
BackColor | Background color of the SymbologyControl. | |
BorderStyle | The border style of the SymbologyControl. | |
Clear | Clears all symbols and files from the SymbologyControl. | |
CustomProperty | A property to associate data with the SymbologyControl. | |
DisplayStyle | The display style of the SymbologyControl. | |
Enabled | Indicates whether the SymbologyControl can respond to user generated events. | |
GetStyleClass (esriSymbologyStyleClass StyleClass) 返回值:ISymbologyStyleClass |
Returns the specified style class from the SymbologyControl. 指定默认选择的符号样式! esriSymbologyStyleClass 枚举:各种样式的集合,包括 Shadow、NorthArrow、ScaleBars 等! string strInstall = ESRI.ArcGIS.RuntimeManager.ActiveRuntime.Path; //获取 Engine 的安装目录 string style = strInstall + @"Styles\ESRI.ServerStyle"; //获取 ESRI 符号的文件 if (System.IO.File.Exists(style)) { axSymbologyControl1.LoadStyleFile(style); //加载样式 axSymbologyControl1.StyleClass = esriSymbologyStyleClass.esriStyleClassNorthArrows; //获取显示的符号类型 |
|
HitTest | Returns the item at the specified x and y coordinates. | |
hWnd | Handle to the window associated with the SymbologyControl. | |
KeyIntercept | A property that specifies interception of key strokes that are normally handled by the container. When intercepted the OnKeyDown and OnKeyUp events will be called. This value can be a combined bit mask of esriKeyIntercept enum values. | |
LoadDesktopStyleFile | Loads a desktop style file into the SymbologyControl. 加载扩展名为 .style 的文件! |
|
LoadStyleFile (string fileName) |
Loads a server style file into the SymbologyControl. 加载扩展名为 .ServerStyle 的文件! //直接插入地址调入: |
|
MouseIcon | Custom mouse icon used if MousePointer is 99. | |
MousePointer | The mouse pointer displayed over the SymbologyControl. | |
Object | A property that returns the underlying control. This can be used when the control is inside a wrapper object that has been added by a development environment. | |
RemoveFile | Removes a file from the SymbologyControl. | |
ShowContextMenu | Indicates if the SymbologyControl displays a context menu. | |
StyleClass 返回值:esriSymbologyStyleClass |
The style class used by the SymbologyControl. 用来获取 SymbologyControl 的符号内容! axSymbologyControl1.StyleClass = esriSymbologyStyleClass.esriStyleClassBorders;
|
---------------------------------------------------------------------------------------------------------
1. Provides access to members that control SymbologyControl style classes.
Description | ||
---|---|---|
AddItem | Adds an item to the SymbologyStyleClass. | |
GetItem | Returns the item at the specified index in the SymbologyStyleClass. | |
GetSelectedItem | Returns the selected item in the SymbologyStyleClass. | |
ItemCount | The number of items in the SymbologyStyleClass. | |
PreviewItem (IStyleGalleryItem item, int Width, int Height) 返回值:IPictureDisp |
Previews the specified item as a bitmap.
ISymbologyStyleClass symbologyStyleClass =
axSymbologyControl1.GetStyleClass(axSymbologyControl1.StyleClass);
//
Preview an image of the symbol stdole.IPictureDisp picture =
symbologyStyleClass.PreviewItem(m_styleGalleryItem, pictureBox1.Width, pictureBox1.Height); System.Drawing.Image image = System.Drawing.Image.FromHbitmap(
new
System.IntPtr(picture.Handle)); pictureBox1.Image = image;
|
|
RemoveAll | Removes all items from the SymbologyStyleClass. | |
RemoveItem | Removes the item at the specified index from the SymbologyStyleClass. | |
SelectItem | Sets the selected item in the SymbologyStyleClass. | |
SortDirection | The sort direction of the items in the SymbologyStyleClass. | |
StyleCategory | The style category used by the SymbologyStyleClass. | |
StyleClass | The class of the symbols in the SymbologyStyleClass. | |
UnselectItem | Unsets the selected item in the SymbologyStyleClass. | |
Update | Updates the contents of the SymbologyStyleClass. |
---------------------------------------------------------------------------------------------------------
1. Provides access to members that define items in the Style Gallery.
Symbols and map elements are stored in the Style Gallery. Each symbol or map element has a unique ID that can be read from the item within the style gallery. A Name and Category are also properties of the items within the style gallery. These two fields, along with the Item itself, can be updated and changed as necessary.
Description | ||
---|---|---|
Category | The category of the item. | |
ID | Id for the item in the Style Gallery. | |
Item | The symbol or map element to be stored in the Style Gallery item. | |
Name | The name of the item in the Style Gallery. |
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Uh个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. Provides access to events that occur with interaction to the SymbologyControl.
This is the main events interface for the SymbologyControl. Generally there is no need to explicitly set event handlers, as most development environments will automatically provide event handlers.
2. 属性和方法:
Description | ||
---|---|---|
OnDoubleClick | Fires when the user presses and releases the mouse button twice in quick succession. | |
OnItemSelected | Fires when an item is selected in the SymbologyControl. 当选中某个选项的时候触发事件! e.styleGalleryItem 获取选项的样式 IStyleGalleryItem styleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem; |
|
OnKeyDown | Fires after a key is pressed on the keyboard. | |
OnKeyUp | Fires after a pressed key is released. | |
OnMouseDown | Fires when the user presses any mouse button while over the SymbologyControl. | |
OnMouseMove | Fires when the user moves the mouse pointer over the SymbologyControl. | |
OnMouseUp | Fires when the user releases a mouse button while over the SymbologyControl. | |
OnStyleClassChanged | Fires when the style class changes. |
--------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Ui 个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. GlobeControl 是一个高性能的嵌入式的开发组件,提供给开发者建立和扩展ArcGlobe 程序,当然也提供了基于ArcGlobe TM 的功能给用户,以便进行绘图等操作。GlobeControl 显示3D 视图,并能提供全球表现的位置,而且是基于3D数据。GlobeControl 控件对应于ArcGlobe 桌面应用程序的三维视图。GlobeControl 封装了G10beViewer 对象, 可以加载ArcGlobe 应用程序创作的Globe文挡。
GlobeControl 也是单一的开发进程, 并且提供了粗粒度ArcEngine 组件对象,当然也提供了强大纹理着色的ArcEngine 组件。GlobeControl 通过对象接口来操作IGlobe 视图,用户可以通过IGlobeViewer 对象来操作ArcGlobe 应用程序。IGlobeViewer 接象包含一个GlobeDisplay,GlobeDisplay 又包含一个Globe。GlobeControl 提供了经常使用的属性和方法, 例如,GlobeControl 有 GlobeCamera 、Globe 、GlobeDisplay 和 GlobeViewer 等属性, 当然GlobeControl 也能执行一些方法或任务,例如, GlobeControl 有Load3dFile 方法用于导人globe 文档。GlobeControl 是进行三维开发最基本的控件,因为其提供了用户界面,所以更容易进行开发,当然使用对象模型也能很容易地理解及开发三维功能。
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Uj 个 ╠══════════════════════════════════════════════════╣
╚════════╝
1. SceneControl 是一个高性能的嵌入式的开发组件,提供给开发者建立和扩展Scene 程序,当然也提供了基于ArcScene的功能给用户,以便进行绘图等操作。控件SceneControl 相当于ArcScene Desktop 应用程序中的3D视图, 并且提供了显示和增加空间数据到3D 的方法等。
SceneControl 是单一的开发进程,并且提供了粗粒度ArcEngine 组件对象,也提供了强大纹理着色的功能。SceneControl 通过对象接口ISceneViewer 来表现。ISceneViewer 接口提供了一个Camera 对象, 该对象囱视角( Observer ) 和目标( Target ) 构成。SceneControl 控件提供一些属性和方法镰作三维对象。例如. Camera 、Scene 、SceneGraph 和SceneViewer 等属性。LoadSxFile方法, 用于导人sωne 文挡。SceneControl 是进行三维开发最基本的控件。
---------------------------------------------------------------------------------------------------------
╔════════╗
╠════╣ 第Uk个 ╠══════════════════════════════════════════════════╣
╚════════╝
1.
esriTOCControlItem