摘要: 不要进行无意义的try....catch,只在真的需要catch的地方再处理。应彻底在测试阶段就消灭异常。代码中没有必要每个地方都try...cvatch程序中出现未处理的异常会直接退出,每个地方都try ,,..catch....太麻烦,可以在App中处理 DispatcherUnhandleException新建一个窗体App .xaml.代码如下: 在App .xaml.cs中添加代码如下:using System;using System.Collections.Generic;using System.Configuration;using Syste... 阅读全文
posted @ 2013-08-07 23:17 秋水惜朝 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 员工合同到期前一个月提醒练习:员工生日前一周提醒练习:密码一个月提醒修改一次如何右下角弹窗,SystemParameters.WorkArea.Width 获得屏幕工作区得宽度Window的TopMost设定窗口显示在最前。 阅读全文
posted @ 2013-08-07 23:08 秋水惜朝 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 拍照在单独的窗口进行使用WPFMediaKit开发包,xmlns:wpfmedia="clr-namespace:WPFMediaKit.DirectShow.Control; assembly=WPFMediaKit"使用VideoCaptureElementMultimediaUtil.VideoInputNames 获得所有摄像头captureElement.VideoCaptureSource设定要使用的摄像头(提供一个摄像头选择列表如果没有选择任何摄像头侧报错)拍照获得二进制数据拍照定格效果:captureElement.Pause();拍照完成后允许重拍。 阅读全文
posted @ 2013-08-07 22:43 秋水惜朝 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 数据库中用image类型规格保存二进制数据,ADO.Net是通过byte[]来对应数据。图片的选择:openFileDig选择图片文件,然后把图片拷贝到MemoryStream中显示把图片Stream显示的方法:Bitmapimage bmpimg=new BitmapImage();bmpImg.BeginInit();bmpImg.StreamSource=photoStream;bmpImg.EndInit();imgPhoto.Source=bmpImg; 阅读全文
posted @ 2013-08-07 22:40 秋水惜朝 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Product AvailabilityAvailable with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.DescriptionThe RasterBand object represents an existing band of a raster dataset. This band may be the only band in a single raster dataset or one band in a multiband raster dataset.A RasterBand can be obtained from 阅读全文
posted @ 2013-08-07 17:24 秋水惜朝 阅读(284) 评论(0) 推荐(0) 编辑
摘要: ConstantValueDescriptionPT_UNKNOWN-1Pixel values are unknown.PT_U10Pixel values are 1 bit.PT_U21Pixel values are 2 bits.PT_U42Pixel values are 4 bits.PT_UCHAR3Pixel values are unsigned 8 bit integers.PT_CHAR4Pixel values are 8 bit integers.PT_USHORT5Pixel values are unsigned 16 bit integers.PT_SHORT 阅读全文
posted @ 2013-08-07 17:05 秋水惜朝 阅读(239) 评论(0) 推荐(0) 编辑
摘要: DescriptionA Point is a zero-dimensional object that represents a specific (X, Y) location in a the two-dimensional XY-Plane. A Point may also have Z, M, and ID attributes associated with it. Existence of attributes does not alter the dimensionality of a Point nor does it alter geometric calculation 阅读全文
posted @ 2013-08-07 16:59 秋水惜朝 阅读(533) 评论(0) 推荐(0) 编辑
摘要: 打开栅格目录中的一个数据 IRasterDataset GetRasterCatalogItem(IRasterCatalog pCatalog, int pObjectID) { //栅格目录继承了IFeatureClass IFeatureClass pFeatureClass = (IFeatureClass)pCatalog; IRasterCatalogItem pRasterCatalogItem = (IRasterCatalogItem)pFeatureClass.GetFeature(pObjectID); return pRasterCatalogItem.Ra... 阅读全文
posted @ 2013-08-07 16:15 秋水惜朝 阅读(1536) 评论(0) 推荐(0) 编辑
摘要: When To UseUse IWorkspaceFactory when you need to create a new workspace, connect to an existing workspace or find information about a workspace.MembersDescriptionContainsWorkspaceIndicates if parentDirectory contains a valid workspace, or is a valid file-system workspace.CopyCopies a workspace to t 阅读全文
posted @ 2013-08-07 14:17 秋水惜朝 阅读(986) 评论(0) 推荐(0) 编辑
摘要: 打开栅格数据要打开一个栅格数据,这个有点类似我们打开FeatureClass一样,先要获取工作空间,只不过我们过于要素类的时候需要IFeatureWorkspace,而栅格数据则需要IRasterWorkspace,示例如下: IRasterWorkspace GetRasterWorkspace(string pWsName) { try { IWorkspaceFactory pWorkFact = new RasterWorkspaceFactoryClass(); return pWorkFact.OpenFromFile(pWsName, 0) as IRasterWork... 阅读全文
posted @ 2013-08-07 14:00 秋水惜朝 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 栅格数据介绍 在空间数据库中,Esri对栅格数据提供了三种模型,栅格数据集,栅格目录,以及ArcGIS 10 中新推出的镶嵌数据集。 栅格数据集也就是我们经常所得jpg,tif文件等,ArcGIS 将这些栅格数据抽象为RasterDataset,栅格数据集就代表了磁盘中的一个文件,它由一个或多个波段组成。在使用栅格数据集的时候,栅格数据会被转换成IMG文件存储在数据库中。 我们可以对栅格数据集进行一些操作,如改变空间参考,建立影像金字塔等。栅格目录,正如其名字一样是一个目录,跟书的目录相似,它记录了一个或者多个栅格数据集,每一个栅格数据集都作为一条记录存储在栅格目录中。栅格目录对栅格数据集的管 阅读全文
posted @ 2013-08-07 13:45 秋水惜朝 阅读(518) 评论(0) 推荐(0) 编辑
摘要: void CreateDomain(IWorkspace pWorkspace) { IWorkspaceDomains pWorkspaceDomains = (IWorkspaceDomains)pWorkspace; ICodedValueDomain pCodedValueDomain = new CodedValueDomainClass(); pCodedValueDomain.AddCode("RES", "Residential"); pCodedValueDomain.AddCode("COM", "Com 阅读全文
posted @ 2013-08-07 13:16 秋水惜朝 阅读(250) 评论(0) 推荐(0) 编辑
摘要: public void ChangeFieldAliasName(ITable pTable, string pOriFieldName, string pDesFieldName) { IClassSchemaEdit pClassSchemaEdit = (IClassSchemaEdit)pTable; //给对象加上锁 ISchemaLock pSchemaLock = (ISchemaLock)pTable; pSchemaLock.ChangeSchemaLock(esriSchemaLock.esriExclusiveSchemaLock); if (pTable... 阅读全文
posted @ 2013-08-07 13:08 秋水惜朝 阅读(447) 评论(0) 推荐(0) 编辑
摘要: DescriptionThe IFieldEdit interface is used when creating new fields. You should not use it to modify fields, for that purpose use IClassSchemaEdit. In general, when modifying fields, the restrictions that apply in ArcCatalog also apply in ArcObjects; for example, you cannot change the name or type 阅读全文
posted @ 2013-08-07 11:32 秋水惜朝 阅读(656) 评论(0) 推荐(0) 编辑
摘要: DescriptionThe 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 i 阅读全文
posted @ 2013-08-07 11:30 秋水惜朝 阅读(433) 评论(0) 推荐(0) 编辑
摘要: The available kinds of geometry objects.ConstantValueDescriptionesriGeometryNull0A geometry of unknown type.esriGeometryPoint1A single zero dimensional geometry.esriGeometryMultipoint2An ordered collection of points.esriGeometryLine13A straight line segment between two points.esriGeometryCircularArc 阅读全文
posted @ 2013-08-07 11:20 秋水惜朝 阅读(755) 评论(0) 推荐(0) 编辑
摘要: 如何创建一个要素数据类 创建要素类用到了IFeatureWorkspace.CreateFeatureClass方法,在这个方法中有众多的参数,为了满足这些参数,我们要学习和了解下面的接口. IField,IFieldEdit,IFields,IFieldsEditI,GeometryDef,IGeometryDefEdit接口 字段对应表中的一列,一个要素类必须有至少2个字段,而多个字段的集合就构成了字段集,在要素类中,有一个特殊的字段,描述了空间对象,我们称之为几何字段,其中GeometryDef是用来设计几何字段的。这个几何字段定义了要素类的类型,比如说我们要在Catalog创建一个点要 阅读全文
posted @ 2013-08-07 11:05 秋水惜朝 阅读(3370) 评论(0) 推荐(0) 编辑
摘要: 如何删除要素类 要想删除一个要素类,那么必须先得到这个,在得到这个要素类的时候,我们要学习一个新的接口IFeatureWorkspace。 IFeatureWorkspace 接口介绍 这个接口主要是用于管理基于矢量数据的,如表,,要素类,要素数据集等。MembersDescriptionCreateFeatureClassCreates a new standalone feature class under the workspace.CreateFeatureDatasetCreates a new feature dataset.CreateQueryDefCreate a query 阅读全文
posted @ 2013-08-07 10:31 秋水惜朝 阅读(983) 评论(0) 推荐(0) 编辑
摘要: 1.IName(名称对象)介绍数据集对象可以分为两大类,一种是Table,我们无法将Table存储在要素数据集中(可以尝试下),一种是Geodataset,这个是要素类的容器。数据集对象有一个很重要的属性,就是这个Fullname,用这个可以返回和数据集相关的名称对象,而这个名称对象有一个很重要的方法Open(),这个可以获取和这个名称对象相关的对象(内存中的),Open()方法的返回值是object,所以用Open方法的时候,我们必须心里清楚,自己到底是要得到那个对象,然后QI到我们要的对象上。IName对象是一个代表性对象。通过使用IName对象,可以访问它所代表的对象的一些基本属性,而不 阅读全文
posted @ 2013-08-07 10:06 秋水惜朝 阅读(1527) 评论(0) 推荐(0) 编辑
摘要: 在ArcGIS Engine中,要得到某一个类,首要要获取工作空间,然后进入工作空间再得到相应的东西,我们定义一个函数用来获取个人数据库的路径 public string WsPath() { string WsFileName=""; OpenFileDialog OpenFile = new OpenFileDialog(); OpenFile.Filter = "个人数据库(MDB)|*.mdb"; DialogResult DialogR = OpenFile.ShowDialog(); if (DialogR == DialogResult.C 阅读全文
posted @ 2013-08-07 09:34 秋水惜朝 阅读(559) 评论(0) 推荐(0) 编辑