Represents an image which is positioned in relation to the map window.
Namespace:
ESRI.ArcGISExplorer.MappingAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public sealed class ImageOverlay : MapItem, IDisposable |
Visual Basic (Declaration) |
---|
Public NotInheritable Class ImageOverlay _ Inherits MapItem _ Implements IDisposable |
Remarks
An ImageOverlay is an image that is drawn in relation to the map window rather than draped onto the map or globe. Sample uses for an image overlay are logos, advisory text ("Confidential" or "Draft") or graphics that frame the display.
You can position, resize and set the transparent color for an image overlay.
You can superimpose any number of image overlays over the map and from the 1500 release there is now an additional option for doing this:
- Add an image overlay to the map as a map item using the Map.ChildItems.Add method. The image overlay will be listed in the contents window and will be saved with the map document. The map can store multiple image overlay map items which are managed by the ImageOverlayOrderCollection and can be accessed using the ImageOverlayDrawingOrder property.
- The new option is to add an image overlay to the map display as a temporary, screen overlay by adding it directly to an instance of the ImageOverlayOrderCollection returned from the ForegroundOverlays property. The image overlay will not be listed in the contents window and will not be saved with the map document.
The following illustrates the drawing order involving image overlays:
- ESRI logo or logo in an application configuration >Top
- Foreground image overlays
- Slide title
- Map item image overlays
- All other map content > Bottom
Examples
The code below illustrates how to create image overlay objects and how they can be added to either the Map or to the MapDisplay.
CopyC#
//Get a reference to the map display ESRI.ArcGISExplorer.Mapping.MapDisplay disp = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay; //Create image overlay objects and set properties ImageOverlay imgOverlay1 = new ImageOverlay("Logo", @"C:\Data\Images\Logo.jpg"); imgOverlay1.DisplayPosition = DisplayPosition.TopLeft; imgOverlay1.Transparency = 10; ImageOverlay imgOverlay2 = new ImageOverlay("", @"C:\Data\Images\TopSecret.bmp"); imgOverlay2.DisplayPosition = DisplayPosition.BottomLeft; imgOverlay2.Transparency = 40; //Add the first image overlay to the map as a MapItem //i.e. it appears in the contents window disp.Map.ChildItems.Add(imgOverlay1); //Add the second image overlay to the map display as a temporary screen overlay //i.e. it will not appear in the contents window disp.ForegroundOverlays.AddToTop(imgOverlay2); //Save the map document. The next time the map document is opened only the //first "Logo" image overlay will be present. ESRI.ArcGISExplorer.Application.Application.SaveDocument();
CopyVB.NET
'Get a reference to the map display Dim disp As ESRI.ArcGISExplorer.Mapping.MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay 'Create image overlay objects and set properties Dim imgOverlay1 As New ImageOverlay("Logo", "C:\Data\Images\Logo.jpg") imgOverlay1.DisplayPosition = DisplayPosition.TopLeft imgOverlay1.Transparency = 10 Dim imgOverlay2 As New ImageOverlay("", "C:\Data\Images\TopSecret.bmp") imgOverlay2.DisplayPosition = DisplayPosition.BottomLeft imgOverlay2.Transparency = 40 'Add the first image overlay to the map as a MapItem 'i.e. it appears in the contents window disp.Map.ChildItems.Add(imgOverlay1) 'Add the second image overlay to the map display as a temporary screen overlay 'i.e. it does not appear in the contents window disp.ForegroundOverlays.AddToTop(imgOverlay2) 'Save the map document. The next time the map document is opened only 'the first "Logo" image overlay will be present. ESRI.ArcGISExplorer.Application.Application.SaveDocument()
Inheritance Hierarchy
System..::.Object
ESRI.ArcGISExplorer.Mapping..::.MapItem
ESRI.ArcGISExplorer.Mapping..::.ImageOverlay
ESRI.ArcGISExplorer.Mapping..::.MapItem
ESRI.ArcGISExplorer.Mapping..::.ImageOverlay