Gets a Color object which represents the color of the cell at the specified Point.

Namespace:  ESRI.ArcGISExplorer.Data

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public Color GetColorAtPoint(
	Point point
)
Visual Basic (Declaration)
Public Function GetColorAtPoint ( _
	point As Point _
) As Color

Parameters

point
Type: ESRI.ArcGISExplorer.Geometry..::.Point

The Point used to query the Raster. The Point will be projected to the same CoordinateSystem as the Raster if they are different.

Return Value

A Color object representing the color of the cell at the specified location.

Examples

The code below demonstrate how to use the GetColorAtPoint method to set the background color of the raster to be transparent using the color at the clicked location.
CopyC#
{
  //Find a specific raster layer in the table of contents
  RasterLayer mtnRasterLayer = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.FindByName("Cairngorms") as RasterLayer;

  //Capture the user clicked location
  ESRI.ArcGISExplorer.Geometry.Point clickedPoint = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.TrackPoint();

  //Get the color of the raster cell at the clicked location
  System.Drawing.Color clickedColor = mtnRasterLayer.Raster.GetColorAtPoint(clickedPoint);

  //Set the clicked color to be transparent so that it is not displayed
  if (clickedColor.IsEmpty == false)
  {
    mtnRasterLayer.BackgroundTransparentColor = clickedColor;
  }
}
CopyVB.NET
'Find a specific raster layer in the table of contents
Dim mtnRasterLayer As RasterLayer = DirectCast(ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.Map.FindByName("Cairngorms"), RasterLayer)

'Capture the user clicked location
Dim clickedPoint As ESRI.ArcGISExplorer.Geometry.Point = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay.TrackPoint()

'Get the color of the raster cell at the clicked location
Dim clickedColor As System.Drawing.Color = mtnRasterLayer.Raster.GetColorAtPoint(clickedPoint)

'Set the clicked color to be transparent so that it is not displayed
If clickedColor.IsEmpty = False Then
  mtnRasterLayer.BackgroundTransparentColor = clickedColor
End If

See Also