Imagery inlays support both JPEG 2000 (.jp2) and AGI's image format (.pdttx) are supported. Generally, JPEG 2000 images take up less disk space than .pdttx images, but take slightly longer to load due to more sophisticated decompression.
Imagery is added in the same way as terrain as shown in the following example from the HowTo:
// Either jp2 and pdttx can be used here IAgGxCentralBody earth = sceneManager.CentralBodies("Earth"); IAgGxGlobeInlay inlay = scene.GlobeInlayManager.AddURI(earth, Program.uriLocalDataPath + "TerrainAndImagery/StHelens.jp2", AgGxInlayRole.InlayRoleNormal, true);
Imagery is drawn on top of existing geometry, which might be the globe's ellipsoid or one or more terrain inlays as shown below.
|
|
|
|
Terrain and image inlays |
Just image inlay |
Images can be blended with images below them by setting their translucency. This is controlled via the Translucency property. A translucency of 0% means the image is completely opaque, while a translucency of 100% means the image is completely transparent.
The following example sets an image's translucency to 40%.
IAgGxGlobeInlayImage image = inlay as IAgGxGlobeInlayImage; if (image != null) { image.Translucency = 40; }
IAgGxCentralBody earth = sceneManager.CentralBodies("Earth"); IAgGxGlobeInlay topInlay = scene.GlobeInlayManager.AddURI(earth, Program.uriLocalDataPath + "TerrainAndImagery/top.jp2", AgGxInlayRole.InlayRoleNormal, true); IAgGxGlobeInlay bottomInlay = scene.GlobeInlayManager.AddURI(earth, Program.uriLocalDataPath + "TerrainAndImagery/bottom.jp2", AgGxInlayRole.InlayRoleNormal, true); // // Since bottom.jp2 was added after top.jp2, bottom.jp2 will be // drawn on top. Using the render order collection, we swap the // order so top.jp2 is drawn on top of bottom.jp2. // IAgGxGlobeInlayRenderOrderCollection collection = scene.GlobeInlayManager.RenderOrder(earth, AgGxInlayType.InlayTypeImagery); collection.Swap(collection.Find(topInlay), collection.Find(bottomInlay));
The render order for terrain inlays can also be changed by passing eInlayTypeTerrain to RenderOrder.
Since imagery files can be extremely large, the entire file is not kept in memory. Instead, a small portion of the file is kept in a memory cache. As the viewer moves around, parts of the file are paged from disk into the cache. By default, the cache is 32 megabytes. If you are using high resolution imagery or the imagery appears blurry, try increasing the cache to 64 or 128 megabytes as shown below.
sceneManager.GlobeInlaySettings.ImageryCacheSize = 128;
It is not recommended to go above 128 megabytes. Large cache sizes can slow down rendering since so much imagery will be rendered.