zyr987503101
路人甲
路人甲
  • 注册日期2012-11-22
  • 发帖数9
  • QQ
  • 铜币131枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1802回复:2

C# 单个图元如何旋转

楼主#
更多 发布于:2013-01-24 09:21
  现在是Winform  AE开发,其中涉及一个单个图元旋转问题,哪位大侠能给个示例学习学习不,在线等候,谢谢!
喜欢0 评分0
如何你行你一定要,如果你要你一定行!
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2013-02-26 10:23
是在arcengine中实现吗?
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15945
  • QQ554730525
  • 铜币25337枚
  • 威望15352点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
2楼#
发布于:2013-02-26 10:25
<p> 这个是帮助里的说明。</p><p> </p><p>The code below gets the Note currently selected, and uses the GeometryOperations class to             rotate the Geometry of the Graphic of the Note.            The code assumes you have using statements for the Application, Geometry and Mapping namespaces. </p><span id="cbc_1" x-lang="CSharp" codelanguage="CSharp"><p> </p><div class="highlight-title"><span tabindex="0" class="highlight-copycode"><img style="margin-right: 5px;" src="http://help.arcgis.com/en/arcgisexplorer/900/arcgisexplorer/sdk/icons/CopyCode.gif"/>Copy</span>C#</div><div class="code"><pre>SelectedItemsCollection selItems = ESRI.ArcGISExplorer.Application.Application.SelectedItems;
<span class="highlight-keyword">if</span> ((selItems.Count == <span class="highlight-number">1</span>) ;; (selItems[<span class="highlight-number">0</span>] <span class="highlight-keyword">is</span> Note))
{
  Note selected = selItems[<span class="highlight-number">0</span>] <span class="highlight-keyword">as</span> Note;

  <span class="highlight-comment">// Rotate the geometry</span>
  Geometry rotated = GeometryOperations.Rotate(selected.Graphic.Geometry, <span class="highlight-number">90</span>, Unit.Angular.Degrees);

  <span class="highlight-comment">// Alternatively, specify rotation in radians, e.g.</span>
  <span class="highlight-comment">// Geometry rotated = GeometryOperations.Rotate(selected.Graphic.Geometry, 1.570796);</span>

  <span class="highlight-comment">// Update the geometry of the graphic.</span>
  selected.Graphic.Geometry = rotated;
}</pre></div></span><span id="cbc_2" x-lang="VisualBasic" codelanguage="VisualBasic"><div class="highlight-title"><span tabindex="0" class="highlight-copycode"><img style="margin-right: 5px;" src="http://help.arcgis.com/en/arcgisexplorer/900/arcgisexplorer/sdk/icons/CopyCode.gif"/>Copy</span>VB.NET</div><div class="code"><pre><span class="highlight-keyword">Dim</span> selItems <span class="highlight-keyword">As</span> SelectedItemsCollection = ESRI.ArcGISExplorer.Application.Application.SelectedItems

<span class="highlight-keyword">If</span> selItems.Count = <span class="highlight-number">1</span> <span class="highlight-keyword">AndAlso</span> <span class="highlight-keyword">TypeOf</span> selItems(<span class="highlight-number">0</span>) <span class="highlight-keyword">Is</span> Note <span class="highlight-keyword">Then</span>
  <span class="highlight-keyword">Dim</span> selected <span class="highlight-keyword">As</span> Note = selItems(<span class="highlight-number">0</span>)
  <span class="highlight-keyword">Dim</span> rotated <span class="highlight-keyword">As</span> Geometry = GeometryOperations.Rotate(selected.Graphic.Geometry, <span class="highlight-number">90</span>, Unit.Angular.Degrees)
  <span class="highlight-comment">' Alternatively, specify rotation in radians, e.g.</span>
  <span class="highlight-comment">' Dim rotated As Geometry = GeometryOperations.Rotate(selected.Graphic.Geometry, 1.570796)</span>
  selected.Graphic.Geometry = rotated
<span class="highlight-keyword">End</span> <span class="highlight-keyword">If</span></pre></div></span>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部