Parameters
- member
- mapMember
- oid
- object ID
Exception | Description |
---|---|
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
QueuedTask.Run(() => { // get the currently selected features in the map var selectedFeatures = ArcGIS.Desktop.Mapping.MapView.Active.Map.GetSelection(); // get the first layer and its corresponding selected feature OIDs var firstSelectionSet = selectedFeatures.ToDictionary().First(); // create an instance of the inspector class var inspector = new ArcGIS.Desktop.Editing.Attributes.Inspector(); // load the selected features into the inspector using a list of object IDs inspector.Load(firstSelectionSet.Key, firstSelectionSet.Value); //get the value of var pscode = inspector["STATE_NAME"]; var myGeometry = inspector.Shape; });
QueuedTask.Run(() => { var sel = MapView.Active.Map.GetSelection(); //Read a raster from a raster field as an InteropBitmap //the bitmap can then be used as an imagesource or written to disk var insp = new ArcGIS.Desktop.Editing.Attributes.Inspector(); insp.Load(sel.ToDictionary().Keys.First(), sel.ToDictionary().Values.First()); var ibmp = insp["Photo"] as System.Windows.Interop.InteropBitmap; });
QueuedTask.Run(() => { var sel = MapView.Active.Map.GetSelection(); //Insert an image into a raster field //Image will be written with no compression var insp = new ArcGIS.Desktop.Editing.Attributes.Inspector(); insp.Load(sel.ToDictionary().Keys.First(), sel.ToDictionary().Values.First()); insp["Photo"] = @"e:\temp\Hydrant.jpg"; var op = new EditOperation(); op.Name = "Raster Inspector"; op.Modify(insp); op.Execute(); });
Target Platforms: Windows 11, Windows 10, Windows 8.1