laptop and a wrench

漏洞

When attempting to create a graphic from an image in a generated layout using an ArcGIS Pro add-in, the graphic is larger than the envelope.

上次发布: December 30, 2019 ArcGIS Pro SDK for .NET
漏洞 ID 编号 BUG-000126736
已提交November 13, 2019
上次修改时间June 5, 2024
适用范围ArcGIS Pro SDK for .NET
找到的版本N/A
操作系统Windows OS
操作系统版本10.0 64 Bit
状态Will Not Be Addressed

附加信息

The correct way to accomplish the desired result is to create a map graphic. Refer to the sample code below. ``` await QueuedTask.Run(() => { var selectedFeature = MapView.Active?.Map?.GetSelection()?.ToDictionary()?.FirstOrDefault(); if (selectedFeature == null) return; var container = MapView.Active.Map.TargetGraphicsLayer; if (container == null) return; var mapMember = selectedFeature.Value.Key as FeatureLayer; var filter = new ArcGIS.Core.Data.QueryFilter() { ObjectIDs = selectedFeature.Value.Value }; using (var cursor = mapMember.Search(filter)) { while (cursor.MoveNext()) { var feature = cursor.Current as Feature; var shape = feature.GetShape(); var graphic = ElementFactory.Instance.CreatePictureGraphicElement( container, shape.Extent, @"C:\Temp\code\sdk\EsriBugShow\TestLogo.png"); } } });```

解决办法

The following is the workaround of the issue:

 

if (graphic.GetWidth() * graphic.GetHeight() <= envelope.Area)

      {

       return graphic;

      }

      graphic.SetHeight(envelope.Height);

      graphic.SetWidth(envelope.Width

重现步骤

漏洞 ID: BUG-000126736

软件:

  • ArcGIS Pro SDK for .NET

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项