laptop and a wrench

Bogue

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.

Dernière publication: December 30, 2019 ArcGIS Pro SDK for .NET
Numéro d’ID de bogue BUG-000126736
EnvoiNovember 13, 2019
Dernière modificationJune 5, 2024
S’applique àArcGIS Pro SDK for .NET
Version trouvéeN/A
Système d’exploitationWindows OS
Version du système d’exploitation10.0 64 Bit
StatutWill Not Be Addressed

Informations supplémentaires

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"); } } });```

Solution de contournement

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

Étapes pour reproduire

ID de bogue: BUG-000126736

Logiciel:

  • ArcGIS Pro SDK for .NET

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement