資源簡介
ArcEngine中的ILegend和ILegendItem使用起來總覺得不讓人滿意,特別是AdjustColumns和Item。因此把PageLayout的圖例想象成很多Element的組合,基于IElement重新實現(xiàn)了圖例類。圖例類的類圖可以參考附件中的圖例繪制.bmp。
另外,附件中有示例程序,示例mxd,還有源碼。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?ESRI.ArcGIS.Geometry;
using?System.Collections;
namespace?ComDll.Legend
{
????///?
????///?負責給圖例里的所有元素進行布局
????///?
????public?class?ComLayout
????{
????????private?static?double?m_PatchWidth?=?1.6953?/?2;
????????private?static?double?m_PatchHeight?=?1.6953?/?2;
????????private?static?double?m_SpaceInStandardItem?=?0.2743?/?2;
????????private?static?double?m_InnerSpaceX?=?0.6513;?//0.6513?/?2;
????????private?static?double?m_InnerSpaceY?=?0.2948?/?2;
????????private?static?double?m_frameSpaceX?=?0.6677?/?2;
????????private?static?double?m_frameSpaceY?=?0.7234?/?2;
????????private?double[]?m_ColsWidth;
????????///?
????????///?圖例的邊界
????????///?
????????private?IEnvelope?m_frame;
????????public?IEnvelope?m_frame
????????{
????????????get?{?return?m_frame;?}
????????????set?{?m_frame?=?value;?}
????????}
????????///?
????????///?標題位置
????????///?
????????private?IEnvelope?m_title;
????????public?IEnvelope?m_title
????????{
????????????get?{?return?m_title;?}
????????????set?{?m_title?=?value;?}
????????}
????????///?
????????///?標題高度
????????///?
????????private?double?m_titleHeight;
????????public?double?m_titleHeight
????????{
????????????get?{?return?m_titleHeight;?}
????????????set?{?m_titleHeight?=?value;?}
????????}
????????///?
????????///?行數(shù)不可設置
????????///?
????????private?int?m_rowCount;
????????public?int?m_RowCount
????????{
????????????get?{?return?m_rowCount;?}
????????}
????????private?int?m_colCount;
????????public?int?m_ColCount
????????{
????????????get?{?return?m_colCount;?}
????????????set?{?m_colCount?=?value;?}
????????}
????????private?ArrayList?m_envelopes;
????????public?ArrayList?m_Envelopes
????????{
????????????get?{?return?m_envelopes;?}
????????????set?{?m_envelopes?=?value;?}
????????}
????????///?
????????///?所有圖例的寬,只有寬度是不確定的(文字字數(shù)影響)
????????///?
????????private?ArrayList?m_widths;
????????public?ArrayList?m_Widths
????????{
????????????get?{?return?m_widths;?}
????????????set?{?m_widths?=?value;?}
????????}
????????private?double?m_originX?=?1.0;???//左下角
????????private?double?m_originY?=?1.0;
????????public?ComLayout(ArrayList?envelopes)
????????{
????????????m_colCount?=?1;
????????????m_titleHeight?=?0.835;
????????????m_envelopes?=?new?ArrayList();
????????????for?(int?i?=?0;?i?????????????{
????????????????m_envelopes.Add(envelopes[i]);
????????????}
????????????m_widths?=?new?ArrayList();
????????????for?(int?i?=?0;?i?????????????{
????????????????m_widths.Add((m_envelopes[i]?as?StandardLegendItem).m_Envelope.Width);
????????????}
????????}
????????private?double?CalcOffsetX(int?index?double[]?d)
????????{
????????????double?offsetx?=?m_
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????16896??2011-11-28?11:22??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\ComBasic.dll
?????文件?????160256??2011-11-28?11:22??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\ComMap.dll
?????文件??????54272??2011-11-28?17:36??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\CustomLegendClassByGxp.dll
?????文件?????159232??2011-11-28?17:36??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\CustomLegendClassByGxp.pdb
????.......???3350528??2011-05-04?09:52??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\DevComponents.DotNetBar2.dll
?????文件?????385536??2011-11-28?11:22??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\MarkerLib.dll
?????文件????1276720??2007-10-10?09:49??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\Microsoft.Office.Interop.Excel.dll
?????文件??????64288??2007-10-10?09:49??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\Microsoft.Vbe.Interop.dll
?????文件?????282624??2009-09-08?02:17??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\NLog.dll
?????文件?????416544??2007-10-10?09:49??TestCustomLegendDll\CustomLegendClassByGxp\bin\Debug\office.dll
?????文件???????6760??2011-11-28?17:14??TestCustomLegendDll\CustomLegendClassByGxp\CustomLegendClassByGxp.csproj
?????文件??????11444??2011-11-25?16:23??TestCustomLegendDll\CustomLegendClassByGxp\Legend\ComLayout.cs
?????文件???????5897??2011-11-25?17:34??TestCustomLegendDll\CustomLegendClassByGxp\Legend\ComLegend.cs
?????文件??????12792??2011-11-24?08:57??TestCustomLegendDll\CustomLegendClassByGxp\Legend\CustomComLegendItem.cs
?????文件???????2375??2011-11-24?16:45??TestCustomLegendDll\CustomLegendClassByGxp\Legend\fr
?????文件???????2837??2011-11-24?14:06??TestCustomLegendDll\CustomLegendClassByGxp\Legend\GridLineItem.cs
?????文件???????5710??2011-11-28?17:36??TestCustomLegendDll\CustomLegendClassByGxp\Legend\LegendPump.cs
?????文件???????6503??2011-11-25?17:34??TestCustomLegendDll\CustomLegendClassByGxp\Legend\PageLayoutLegend.cs
?????文件???????1922??2011-11-24?17:32??TestCustomLegendDll\CustomLegendClassByGxp\Legend\PageLayoutLegendItem.cs
?????文件??????16513??2011-11-24?17:40??TestCustomLegendDll\CustomLegendClassByGxp\Legend\StandardLegendItem.cs
?????文件???????3470??2011-11-24?16:34??TestCustomLegendDll\CustomLegendClassByGxp\Legend\ti
?????文件??????12748??2011-11-28?17:31??TestCustomLegendDll\CustomLegendClassByGxp\Legend\UI\CustomLegendFrm.cs
?????文件???????4676??2011-11-24?16:59??TestCustomLegendDll\CustomLegendClassByGxp\Legend\UI\CustomLegendFrm.Designer.cs
?????文件???????5814??2011-11-24?16:59??TestCustomLegendDll\CustomLegendClassByGxp\Legend\UI\CustomLegendFrm.resx
?????文件???????5401??2011-11-28?17:14??TestCustomLegendDll\CustomLegendClassByGxp\Legend\UI\LegendSelectUI.cs
?????文件???????6226??2011-11-24?16:59??TestCustomLegendDll\CustomLegendClassByGxp\Legend\UI\LegendSelectUI.Designer.cs
?????文件???????5814??2011-11-24?16:59??TestCustomLegendDll\CustomLegendClassByGxp\Legend\UI\LegendSelectUI.resx
?????文件??????10090??2011-11-25?09:55??TestCustomLegendDll\CustomLegendClassByGxp\Legend\UI\Legendst
?????文件??????23105??2011-11-25?09:54??TestCustomLegendDll\CustomLegendClassByGxp\Legend\UI\Legendst
?????文件???????7272??2011-11-25?09:54??TestCustomLegendDll\CustomLegendClassByGxp\Legend\UI\Legendst
............此處省略71個文件信息
- 上一篇:仿天貓APP前端
- 下一篇:SiC8051F_uVision4
評論
共有 條評論