收藏 分销(赏)

MapXtreme2008中操作矢量符号及定制符号.doc

上传人:仙人****88 文档编号:7385565 上传时间:2025-01-02 格式:DOC 页数:6 大小:18.55KB 下载积分:10 金币
下载 相关 举报
MapXtreme2008中操作矢量符号及定制符号.doc_第1页
第1页 / 共6页
MapXtreme2008中操作矢量符号及定制符号.doc_第2页
第2页 / 共6页


点击查看更多>>
资源描述
MapXtreme2008中操作矢量符号和定制符号 时间 : 2010-08-02 作者:网络 编辑:Mr.阿布 点击: 55 [ 评论 ] - -   MapXtreme 在其安装过程中自动安装 10 种 MapInfo 特定的 TrueType 字体。这些字体为用户提供了字形符号选择,范围涉及天气、房地产、交通等。字形编号为 Unicode 字符值,由于这些编号位于第一个 Unicode 字符代码块范围内,因此,与 ASCII 字符集兼容。   MapXtreme包含三种点样式:BitmapPointStyle (位图点样式)、FontPointStyle(字体点样式)和SimpleVectorPointStyle(简单矢量点样式)。   简单矢量点样式   此样式包含使用MapInfo 3.0 兼容专有字体用于绘制点的样式属性(MapInfow.fnt)。SimpleVectorPointStyle 属性包括了要为点绘制的实际符号的颜色、点大小和形状码。标准集包括符号31 至67。以下是符号与形状码的对应图,31是空。在比较简单的场合使用此样式已经足够,但是很多场合都不简单。   结构: public SimpleVectorPointStyle(    short code,    Color color,    double pointSize );   code        上面图片中对应的形状码   color        填充符号的颜色,上面图片中为黑色   pointSize    符号大小   字体点样式   使用FontPointStyle 类可以显示TrueType字体集,允许的最大点大小为240 点。这给了我们很大的自由空间,其中的MapInfo Symbols字体和上面的字体是相同的,不过MapInfo Symbols是TrueType字符集。MapXtreme自带的字体:   Map Symbols   MapInfo Arrows   MapInfo Cartographic   MapInfo Miscellaneous   MapInfo Oil&Gas   MapInfo Real Estate   MapInfo Shields   MapInfo Symbols   MapInfo Transportation   MapInfo Weather   可以使用一些相关软件查看这些字体的具体内容,比如 字体试衣间 、微软自带的 字符映射表 。 public FontPointStyle(    short code,    Font font,    short angle,    Color color,    double pointSize );   code        字体映射的编码   font        字体的样式。很关键,字体样式的强大全靠它了   angle        字体旋转的角度   color        字体填充的颜色   pointSize    字体的大小,12就差不多了   位图点样式   定制的位图符号位于 C:\Program Files\Common Files\MapInfo\MapXtreme\6.x\CustSymb。每个图像的文件扩展名都是 .BMP。可以用编程方式通过 MapInfo.Styles 命名空间中的 BitmapPointStyleRepository 集合类访问这些符号。可以创建自己的位图图像并将其添加到 CustSymb 目录。尽管事实上对创建的图像没有大小限制,不过 MapXtreme 显示图像的能力取决于可用的内存。图像不一定必须是方形,而且还可以具有最多24 位颜色深度。要确保图像以其高度和宽度显示,则必须在各自图像的 BitmapPointStyle 对象中将Boolean "NativeSize" 属性设置为 true。   位图点样式应该是最可能被用到的样式。它通过自定义的图片来标识地图上的图元。位图点样式具有ShowWhiteBackground 属性;如果设置为false,则位图中的白像素为透明。默认情况下,ShowWhiteBackground 被设置为false。 public BitmapPointStyle(    string strName,    BitmapStyles style,    Color color,    double pointSize );   strName        夕頭議?斤揃抄紗貧兆各。匯違夕頭議功揃抄頁  X:\Program Files\Common Files\MapInfo\MapXtreme\6.x\CustSymb    X葎芦廾徒。揖扮夕頭匆慧壓椎戦。   style            夕頭議劔塀。   None: 梓潮範議彜蓑?幣。旺拝易弼何蛍繍邑苧。   ShowWhiteBackground: ?幣易弼何蛍。   ApplyColor: 壓炎紛嶄議邑苧何蛍繍喘及眉倖歌方議冲弼野割.   NativeSize: 梓炎紛議寔糞寄弌才?殆?幣?及膨?歌方繍涙丼.   color        易弼何蛍議野割弼   pointSize    炎紛寄弌   和中蛍艶初府宸叱嶽夕炎泌採壓Web嶄耶紗婢幣,和中双竃?購旗鷹。         protected void Page_Load(object sender, System.EventArgs e)         {             if (StateManager.IsManualState())             {                 MapInfo.Mapping.Map myMap = GetMapObj();                 if (Session.IsNewSession)                 {                     MapInfo.WebControls.MapControlModel controlModel = MapControlModel.SetDefaultModelInSession();                     //instanciate AppStateManager class                     AppStateManager myStateManager = new AppStateManager();                     //put current map alias to state manager dictionary                     myStateManager.ParamsDictionary[StateManager.ActiveMapAliasKey] = this.MapControl1.MapAlias;                     //put state manager to session                     StateManager.PutStateManagerInSession(myStateManager);                     #region 霞編旗鷹                     if (myMap != null)                     {                         if (myMap.Layers["TempLayerAlias"] != null)                         {                             myMap.Layers.Remove("TempLayerAlias");                         }                     }                     // Need to clean up "dirty" temp table left by other customer requests.                     MapInfo.Engine.Session.Current.Catalog.CloseTable("TempTableAlias");                     // Need to clear the DefautlSelection.                     MapInfo.Engine.Session.Current.Selections.DefaultSelection.Clear();                     // Creat a temp table and AddPintPointCommand will add features into it.                     MapInfo.Data.TableInfoMemTable ti = new MapInfo.Data.TableInfoMemTable("TempTableAlias");                     // Make the table mappable                     ti.Columns.Add(MapInfo.Data.ColumnFactory.CreateFeatureGeometryColumn(myMap.GetDisplayCoordSys()));                     ti.Columns.Add(MapInfo.Data.ColumnFactory.CreateStyleColumn());                     MapInfo.Data.Table table = MapInfo.Engine.Session.Current.Catalog.CreateTable(ti);                     // Create a new FeatureLayer based on the temp table, so we can see the temp table on the map.                     myMap.Layers.Insert(0, new FeatureLayer(table, "templayer", "TempLayerAlias"));                     IMapLayer lyr = myMap.Layers["TempLayerAlias"];                     if (lyr == null) return;                     FeatureLayer fLyr = lyr as FeatureLayer;                     MapInfo.Geometry.DPoint point = new DPoint(100, 20);                     MapInfo.Geometry.Point geoPoint = new MapInfo.Geometry.Point(myMap.GetDisplayCoordSys(), point);                                          // 幹秀坪崔MapInfo憲催夕炎                     SimpleVectorPointStyle vStyle = new SimpleVectorPointStyle();                     vStyle.Code = 67;                     vStyle.Color = Color.Red;                     vStyle.PointSize = Convert.ToInt16(48);                     vStyle.Attributes = StyleAttributes.PointAttributes.BaseAll;                     vStyle.SetApplyAll();                     // Create a Feature which contains a Point geometry and insert it into temp table.                     Feature feature = new Feature(geoPoint, vStyle);                     MapInfo.Data.Key key = fLyr.Table.InsertFeature(feature);                     //幹秀徭協吶了夕劔塀                     //了夕?斤噐了崔C:\Program Files\Common Files\MapInfo\MapXtreme\6.8.0\CustSymb                     string fileName = @"AMBU1-32.BMP";                     BitmapPointStyle bStyle = new BitmapPointStyle(fileName);                     bStyle.PointSize = Convert.ToInt16(24);                     bStyle.NativeSize = true;                     bStyle.Attributes = StyleAttributes.PointAttributes.BaseAll;                     bStyle.SetApplyAll();                     point = new DPoint(140, 55);                     geoPoint = new MapInfo.Geometry.Point(myMap.GetDisplayCoordSys(), point);                     feature = new Feature(geoPoint, bStyle);                     key = fLyr.Table.InsertFeature(feature);                     //耶紗忖悶夕劔塀                     //FontPointStyle fStyle = new FontPointStyle();                     //fStyle.Color = Color.Red;                     //fStyle.Font.Name = "NewCom Vehicle";                     //fStyle.PointSize = Convert.ToInt16(24);                     //fStyle.Attributes = StyleAttributes.PointAttributes.BaseAll;                     //fStyle.SetApplyAll();                     FontPointStyle fStyle = new FontPointStyle();                     fStyle.Code = 66;                     fStyle.PointSize = 48;                     fStyle.Color = System.Drawing.Color.Red;                     fStyle.Font.Name = "Uniwill";                     fStyle.Font.FontWeight = MapInfo.Styles.FontWeight.Bold;                     fStyle.Angle = 900;                     point = new DPoint(180, 85);                     geoPoint = new MapInfo.Geometry.Point(myMap.GetDisplayCoordSys(), point);                     feature = new Feature(geoPoint, fStyle);                     key = fLyr.Table.InsertFeature(feature);                     #endregion                 }                 // Now Restore State                 StateManager.GetStateManagerFromSession().RestoreState();             }         }   凪麿何蛍議?購旗鷹泌和?         // At the time of unloading the page, save the state         protected void Page_UnLoad(object sender, System.EventArgs e)         {             if (StateManager.IsManualState())             {                 StateManager.GetStateManagerFromSession().SaveState();             }         }         private MapInfo.Mapping.Map GetMapObj()         {             MapInfo.Mapping.Map myMap = MapInfo.Engine.Session.Current.MapFactory[MapControl1.MapAlias];             if (myMap == null)             {                 myMap = MapInfo.Engine.Session.Current.MapFactory[0];             }             return myMap;         }   參貧誼欺議順中丼惚泌和夕侭幣?蛍艶嗤3倖斤哘議夕炎嚥岻斤哘。   竃侃?  貧匯鐙? WinForm順中蝕窟岻^OutLookBar ̄垢醤訳 和匯鐙? WinForm順中蝕窟岻下蕉陣周"WeifenLuo.WinFormsUI.Docking"議聞喘 文章出处:飞诺网():
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 教育专区 > 小学其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服