Description
Extracts a band or set of bands from the source raster. The extract format property specifies the bands and the order of the bands that will be extracted.
Public Properties
ExtractFormat | Gets or sets the raster format containing the bands and the order of the bands that will be extracted. |
Interfaces
CoClasses that Implement IAgStkGraphicsBandExtractFilter
Example
Extract the alpha component from an image
[C#] |
---|
IAgStkGraphicsSceneManager manager = ((IAgScenario)root.CurrentScenario).SceneManager;
IAgStkGraphicsScreenOverlayCollectionBase overlayManager = (IAgStkGraphicsScreenOverlayCollectionBase)manager.ScreenOverlays.Overlays;
//
// The URI can be a file path, http, https, or ftp location
//
IAgStkGraphicsRaster image = manager.Initializers.Raster.InitializeWithStringUri(
imageFile);
//
// Extract the alpha channel from the image
//
IAgStkGraphicsBandExtractFilter channelExtract = manager.Initializers.BandExtractFilter.InitializeWithBand(AgEStkGraphicsRasterBand.eStkGraphicsRasterBandAlpha);
image.ApplyInPlace((IAgStkGraphicsRasterFilter)channelExtract);
IAgStkGraphicsRendererTexture2D texture = manager.Textures.FromRaster(image);
//
// Display the image using a screen overlay
//
IAgStkGraphicsTextureScreenOverlay overlay = manager.Initializers.TextureScreenOverlay.Initialize();
((IAgStkGraphicsOverlay)overlay).Width = 0.2;
((IAgStkGraphicsOverlay)overlay).WidthUnit = AgEStkGraphicsScreenOverlayUnit.eStkGraphicsScreenOverlayUnitFraction;
((IAgStkGraphicsOverlay)overlay).Height = 0.2;
((IAgStkGraphicsOverlay)overlay).HeightUnit = AgEStkGraphicsScreenOverlayUnit.eStkGraphicsScreenOverlayUnitFraction;
((IAgStkGraphicsOverlay)overlay).Origin = AgEStkGraphicsScreenOverlayOrigin.eStkGraphicsScreenOverlayOriginTopRight;
overlay.Texture = texture;
overlayManager.Add((IAgStkGraphicsScreenOverlay)overlay);
|
|
Extract the alpha component from an image
[Visual Basic .NET] |
---|
Dim manager As IAgStkGraphicsSceneManager = DirectCast(root.CurrentScenario, IAgScenario).SceneManager
Dim overlayManager As IAgStkGraphicsScreenOverlayCollectionBase = DirectCast(manager.ScreenOverlays.Overlays, IAgStkGraphicsScreenOverlayCollectionBase)
'
' The URI can be a file path, http, https, or ftp location
'
Dim image As IAgStkGraphicsRaster = manager.Initializers.Raster.InitializeWithStringUri( _
imageFile)
'
' Extract the alpha channel from the image
'
Dim channelExtract As IAgStkGraphicsBandExtractFilter = manager.Initializers.BandExtractFilter.InitializeWithBand(AgEStkGraphicsRasterBand.eStkGraphicsRasterBandAlpha)
image.ApplyInPlace(DirectCast(channelExtract, IAgStkGraphicsRasterFilter))
Dim texture As IAgStkGraphicsRendererTexture2D = manager.Textures.FromRaster(image)
Dim overlay As IAgStkGraphicsTextureScreenOverlay = manager.Initializers.TextureScreenOverlay.Initialize()
DirectCast(overlay, IAgStkGraphicsOverlay).Width = 0.2
DirectCast(overlay, IAgStkGraphicsOverlay).WidthUnit = AgEStkGraphicsScreenOverlayUnit.eStkGraphicsScreenOverlayUnitFraction
DirectCast(overlay, IAgStkGraphicsOverlay).Height = 0.2
DirectCast(overlay, IAgStkGraphicsOverlay).HeightUnit = AgEStkGraphicsScreenOverlayUnit.eStkGraphicsScreenOverlayUnitFraction
overlay.Texture = texture
DirectCast(overlay, IAgStkGraphicsOverlay).Origin = AgEStkGraphicsScreenOverlayOrigin.eStkGraphicsScreenOverlayOriginTopRight
overlayManager.Add(DirectCast(overlay, IAgStkGraphicsScreenOverlay))
|
|